2
ซึ่งจะดีกว่าให้ส่งคืน“ ModelAndView” หรือ“ String” บนตัวควบคุม spring3
วิธีการคืน ModelAndView @RequestMapping(value = "/list", method = RequestMethod.GET) public ModelAndView list( @UserAuth UserAuth user, ModelAndView mav) { if (!user.isAuthenticated()) { mav.setViewName("redirect:http://www.test.com/login.jsp"); return mav; } mav.setViewName("list"); mav.addObject("articles", listService.getLists()); return mav; } วิธีการส่งคืนสตริง @RequestMapping(value = "/list", method = RequestMethod.GET) public String list( @UserAuth UserAuth user, Model model) { if (!user.isAuthenticated()) { return …
115
spring-mvc
controller