【发布时间】:2017-08-02 08:42:38
【问题描述】:
如何从数据库中获取所有对象
@RequestMapping(value="/test", method=RequestMethod.GET)
public ModelAndView recoverPass(@RequestParam("num") int num) {
ModelAndView mv = new ModelAndView("test");
mv.addObject("lists",appRepo.findAll(num));
return mv;
}
我在浏览器中输入了http://localhost:8080/test?num=40,但没有结果。 错误是:CrudRepository 中的 findall 不能应用于 (int)
【问题讨论】:
标签: java spring spring-mvc spring-boot