使用jstl c:foreach 获取model值 获取不到

前端:

在线问答

在线提问
序号问题回答次数修改时间
${ items.getId() }${ items.getTitle() }${ items.getAnswercount() }${ items.getLastmodified() }
后端: @Controller public class UserController { @Resource AnswersService answersService; @Resource QuestionsService questionsService; @RequestMapping("/") public String index(Model model) { System.out.println("跳转到首页"); QuestionsExample questionsExample = new QuestionsExample(); questionsExample.setOrderByClause("lastmodified desc"); List selectByExample=questionsService.selectByExample(questionsExample); model.addAttribute("QuestionList", selectByExample); for (Questions questions : selectByExample) { System.out.println(questions); } return "index"; }

版权声明:本文为weixin_45548349原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。