@RequestMapping("showAlldate") @ResponseBody public String showAlldate(Model model){ List<TrafficEconomyAmapSpeedRawHz> list=otherService.getAll(); model.addAttribute("list",otherService.getAll()); return "jsp/showall.jsp";
}
直接返回
jsp/showall.jsp删掉@ResponseBody因为默认返回字符串,指定了字符串的形式响应
本文介绍了一个用于展示所有日期数据的方法,通过使用@RequestMapping注解映射URL路径,配合@ResponseBody直接返回字符串形式的数据。此方法通过调用otherService.getAll()获取所有数据,并将其添加到Model对象中传递给JSP页面。
1128

被折叠的 条评论
为什么被折叠?



