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

后端 未结 5 1537
野趣味
野趣味 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

    Could still be useful with @RestController for creating redirect fallback to you REST Api

    @GetMapping("/**")
    public ModelAndView Default()
    {
        ModelAndView mav = new ModelAndView("redirect:/actuator/health");
        return mav;
    }
    

提交回复
热议问题