configuration file:
service:
public class GoodsService{
private GoodsDAO goodsdao;
public GoodsDAO getGoodsdao() {
return goodsdao;
}
public void setGoodsdao(GoodsDAO goodsdao) {
this.goodsdao = goodsdao;
}
public GoodsSC queGoodsById(int id){
return goodsdao.queryByid(id);
}
}
------ Solution ------------------------------------- -------
database does not exist will not be recorded ?
------ Solution ---------------------------------------- ----
put that sf of the bean also posted out
------ Solution ---------------------- ----------------------
the call GoodsService place stickers.
theoretically
This node should be added to an attribute prototype = "singleton"
------ For reference only ---------------------- -----------------
no, I start with the database query out all the data, and then in the form of a hyperlink id query by calling this method , it is impossible to have a database problem does not exist
------ For reference only ----------------------------- ----------
it is not very clear. Landlord may then check the configuration file to see if there is no leakage of injected class ( but not injected , it should be throwing NullPointerException ...).
------ For reference only -------------------------------------- -
bean configuration files that I have posted, but it really is a null pointer exception reported after examination found no injection
------ For reference only ---- -----------------------------------
There is no need GETGOODSDAO this method
--- --- For reference only ---------------------------------------
public class GoodsService{
private GoodsDAO goodsdao;
public GoodsSC queGoodsById(int id){
return goodsdao.queryByid(id);
}
public void setGoodsdao(GoodsDAO goodsdao) {
this.goodsdao = goodsdao;
}
}
------ For reference only ------------------------------------- -
you inject and action in the set to be the same, do not know the reason
------ For reference only ----------------- ----------------------
should not be the problem, after removing or not
------ For reference only ---------------------------------------
I checked yes consistent, and I for one another attribute name is still the same not
------ For reference only ----------------------- ----------------
and your service of bean
------ For reference only ------------- --------------------------
sf of bean:
service of bean:
------ For reference only --------------------------- ------------
This is mislabeled , or which have less xml
------ For reference only ---------------- -----------------------
amount posted the wrong
------ For reference only ------------------------- --------------
should be scope = "singleton" , huh but not that by default singleton do ? But once you went to check reminder service parts and found an error in the action method turned out to be inside a gs re new object
------ For reference only ---------------------------------------
problem has been found , the original method in action inside a gs re new object caused , thank you for your answer
没有评论:
发表评论