When I use spring3 @Controller like this:
@RequestMapping("/userCenter")
@Controller
public class LoginCtrl {
@RequestMapping("/loginPage")
public String login(HttpServletRequest request,HttpServletResponse response,Model model) throws Exception {
return "userCenter/loginPage";
}
}
It is ok, I get the the loginPage.jsp right content in browser.
but when I change @Controller to @RestController
the localhost:8080//userCenter/loginPage return a page with the string "userCenter/loginPage"
So,how could I use @RestController to get jsp pages like @Controller?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…