2
Mana yang lebih baik, kembalikan "ModelAndView" atau "String" pada pengontrol spring3
Cara mengembalikan 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; } Cara mengembalikan String @RequestMapping(value = "/list", method = RequestMethod.GET) public String list( @UserAuth UserAuth user, Model model) { if …
115
spring-mvc
controller