how to use spring4 @RestController to return a jsp page?

后端 未结 5 1544
野趣味
野趣味 2020-12-10 16:59

When I use spring3 @Controller like this:

@RequestMapping(\"/userCenter\")

@Controller
public class LoginCtrl {
    @RequestMapping(\"/loginPage\")
    publ         


        
5条回答
  •  暖寄归人
    2020-12-10 17:14

    Check the API docs for @RestController it is annotated with @ResponseBody itself, which indicates that method return value should be bound to the web response body. The configured view objects will never come into play, so it cannot map to any view. My question is why you want to use the RestController anyway, its not meant to map to any views?

提交回复
热议问题