使用@RestController跳转页面
代码如下
@RequestMapping("/user")
@RestController
public class User{
@RequestMapping(value = "/login", method = RequestMethod.GET)
public ModelAndView login(){
//会跳转到login页面
return new ModelAndView("login");
}
@RequestMapping(value = "/userLogin", method = RequestMethod.POST)
public ModelAndView login(String uname,String pwd,@RequestParam(value = "rm",required = false) Boolean rm){
......
//会跳转到userLogin页面
return new ModelAndView("userLogin");
}
}