struts2遍历显示数据库某个表中的所有信息
我想在也面上显示数据库某一张表的信息,Action如下,user.jsp应该怎么写才能接收到值?@Override@Action(value="getSysUsers",...
我想在也面上显示数据库某一张表的信息,Action如下,user.jsp应该怎么写才能接收到值?
@Override
@Action(value="getSysUsers",results={@Result(name="success",location="/test/user.jsp"),@Result(name="bySuccess",location="/test/getSysUsersModelDriven.jsp")})
//@Action(value = "getSysUsers", results = { @Result(name = "success", type = "json") })
public String execute() throws Exception {
list = sysuserService.getUsers();
return SUCCESS;
} 展开
@Override
@Action(value="getSysUsers",results={@Result(name="success",location="/test/user.jsp"),@Result(name="bySuccess",location="/test/getSysUsersModelDriven.jsp")})
//@Action(value = "getSysUsers", results = { @Result(name = "success", type = "json") })
public String execute() throws Exception {
list = sysuserService.getUsers();
return SUCCESS;
} 展开
3个回答
展开全部
struts2啊,你的action类是继承的com.opensymphony.xwork2.ActionSupport吗?是的话,ActionContext.getContext().put("list", list);前台jstl标签直接c:forEach就能出东西。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询