My action is :
public String goodsMore ()
{
Map request = (Map) ServletActionContext.getContext () get ("request").;
String sql = "from TGoods where goodsDel = 'no' order by goodsId";
List goodsList = goodsDAO.getHibernateTemplate () find (sql).;
for (int i = 0; i
goodsList.add (new TGoods ());
}
request.put ("goodsList", goodsList);
return ActionSupport.SUCCESS;
}
Then I need to traverse the pages are :
Name | Price | Pictures |
"> | ¥ | "> " width = "60" height = "60" border = "0" /> |
Then I have deployed in the struts.xml
But now is the total return null values. . . Great God seeking guidance
------ Solution ------------------------------------- -------
landlord you first look at the background debug goodsList after querying the database has a value
------ Solution -------------- ------------------------------
first debug facie request.put ("goodsList", goodsList); goodsList this time there is no value
------ Solution ----------------------------- ---------------
value = "# request.goodsList" changed value = "goodsList" try, suggested backstage look at the value of the request , there is no place go
------ Solution --------------------------------------- -----
you debug a look back to the last data acquisition did
------ Solution -------------------- ------------------------
run select debug mode
------ For reference only ------- --------------------------------
goodsList.add (new TGoods ());
doing with
------ For reference only ------------------------------- --------
This is what I modeled another traversal page write code that page that the title did not , but I wrote this how can not get out
------ For reference only ----- ----------------------------------
I too white . . Will see how the background debug
------ For reference only ---------------------------------------
debug mode is enabled or system.out.print (goodsList); ah see if there is a value you. . . .
没有评论:
发表评论