这是controller里代码,为什么用c:foreach显示不出来?

@RequestMapping("/lookboard")
public String lookboard(HttpSession session,Model model)
{
LookmsgService ls=new LookmsgService();
List<BoardMsg> bmsg=ls.lookmsgboard();
System.out.println(bmsg);
model.addAttribute("bmsg", bmsg);

//System.out.println("incontroller:"+rd.getName());
return "/reader/board/lookboard";
}
这是jsp里的代码

<table>

<tbody>
<c:forEach items="${bmsg}" var="record" begin="0" varStatus="status">
<tr>
<td>${record.uno}</td>
<td>${record.msgcontent}</td>
<td><a href="deleMessage?uno=${record.uno}&msgcontent=${record.msgcontent}">删除</a></td>
</tr>
</c:forEach>
</tbody>
</table>

富国沪深
浏览 158回答 1
1回答

神不在的星期二

@RequestMapping("/lookboard")public ModelAndView lookboard(){ModelAndView model = new ModelAndView("/reader/board/lookboard");LookmsgService ls=new LookmsgService();List<BoardMsg> bmsg=ls.lookmsgboard();System.out.println(bmsg);model.addAttribute("bmsg", bmsg);//System.out.println("incontroller:"+rd.getName());return model;}
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript