在servlet中定义函数
protected void getPersonList(HttpServletRequrst request,HttpServletResponse response)throws ServletException,IOException{
List list=personService.getPersonList();
request.setAttribute("list",list);
request.getRequesyDispatcher("/index.jsp").forward(request,response);
}
在jsp中通过遍历数据库中person类数据
但是在页面中没有显示,而且sql语句也测试通过。
求大神指点。
javaWeb开发中小问题,页面无法显示数据库中内容
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
5条回答 默认 最新
夕阳雨晴 2017-02-17 14:27关注单步调试,先看request.setAttribute("list",list);语句中的list是否有确定的数据,若有确定的数据,在将前端的数据绑定过程贴出来,再分析哈。
解决 无用评论 打赏 举报