SpringBoot使用 thymeleaf+@RestController 跳转页面
thymeleaf推荐使用@Controller进行页面跳转
如果用@RestController,则可以通过ModelAndView进行页面跳转
eg
/**
* 跳转到goods_editor.html页面
* @return
*/
@GetMapping("/goodsEditor")
public ModelAndView goodsEditor(){
ModelAndView mv = new ModelAndView();
mv.setViewName("/goods/goods_editor");
return mv;
}

浙公网安备 33010602011771号