件商品接收不到action的数据

迎着太阳上学 2012-05-14 05:49:50
//NewsAction.java
public String showNews() throws Exception {
String string = "";
try {
if(num == null) {
num = "1";
}
rowCount = newsService.countNews("select count(n) from com.sinosoft.canshishi.pojo.News n", null);
news = newsService.queryNews("from com.sinosoft.canshishi.pojo.News", null, Integer.parseInt(num), pageSize);
System.out.println("news-->" + news.size());
page = new PaginationUtil(pageSize, num, rowCount);

System.out.println("pageSize-->" + pageSize);
System.out.println("num-->" + num);
System.out.println("rowCount-->" + rowCount);
string = "showNews";
} catch(Exception e) {
e.printStackTrace();
string = "error";
}

return string;
}



//_showNews.jsp
<body>
<%
String path = request.getContextPath();
request.setAttribute("path", path);
%>

<c:forEach items="${news}" var="news">
${news.maintitle } <br/>
</c:forEach>
<jsp:include page="/common/_pagination.jsp">
<jsp:param name="url4page" value="${path}/test/newsAction!showNews.action"/>
</jsp:include>
</body>



//显示

首页 前一页 [0] 末页 后一页 共页


...全文
24 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧