SSM框架中JSP页面的<c:forEach>显示不了数据
这是控制器代码:@RequestMapping("/myOrders")publicModelAndViewmyOrders(HttpSessionsession)thr...
这是控制器代码: @RequestMapping("/myOrders") public ModelAndView myOrders(HttpSession session)throws Exception{ MUser user=(MUser) session.getAttribute("user"); List<Orderspojo> myOrderspojoList=ordersService.findMyOrdersList(user.getName()); ModelAndView modelAndView= new ModelAndView(); modelAndView.addObject("myOrderspojoList",myOrderspojoList); modelAndView.setViewName("modules/myproject/MyorderspojoList"); return modelAndView; } 这是jsp页面代码: <table border=1><tr><td>用户</td><td>奖品</td></tr><c:forEach items="${myOrderspojoList}" var="orderspojo" begin="0"><tr><td>${orderspojo.userName }</td><td>${orderspojo.prizeName}</td></tr></c:forEach></table>运行后显示的效果是这样的,页面里的表格都有出现,说明循环执行了,也说明数据传入没问题吧?那为什么显示不了内容呢?本人新手,哪位大神指点一下。。折腾一天了
这是jsp页面代码:
<table border=1>
<tr>
<td>用户</td>
<td>奖品</td>
</tr>
<c:forEach items="${myOrderspojoList}" var="orderspojo" begin="0">
<tr>
<td>${orderspojo.userName }</td>
<td>${orderspojo.prizeName}</td>
</tr>
</c:forEach>
</table> 展开
这是jsp页面代码:
<table border=1>
<tr>
<td>用户</td>
<td>奖品</td>
</tr>
<c:forEach items="${myOrderspojoList}" var="orderspojo" begin="0">
<tr>
<td>${orderspojo.userName }</td>
<td>${orderspojo.prizeName}</td>
</tr>
</c:forEach>
</table> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询