jsp页面数据更新问题
写了一个分页功能
点击主页面上button时调用 buyShoesAction 取出数据,return mapping.findforward("success")
success页 对应 商品.jsp
商品.jsp页面里用iterate 和 bean:write提取并显示从数据库取出的数据
<logic:iterate id="a" name="content" property="list" type="model.Shoes">
id: <bean:write name="a" property="id"/>
name: <bean:write name="a" property="name"/>
</logic:iterate>
<a href="javascript:void(0)" onclick="nextpage()">下一页</a>
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
//一个分页用的类
FenYe fenye = new FenYe();
userDaoImplement userdaoimpl = new userDaoImplement();
//从数据库取出当前页的数据(getAllShopes方法完成)
List<?> list= userdaoimpl.getAllShoes(fenye.getPageSize(),fenye.getPageNum());
//fenye类中list属性用来存放当前页数据
fenye.setList(list);
//把分页类传到jsp页面
request.setAttribute("content", fenye);
return mapping.findForward("success");
}