@GetMapping("getA")
public String getA(){
return "a";
}
@GetMapping("getBToA")
public ModelAndView getBToA(){
RedirectView redirectView=new RedirectView("/getA");
redirectView.setStatusCode(HttpStatus.MOVED_PERMANENTLY);
ModelAndView view=new ModelAndView();
view.setView(redirectView);
return view;
}
【网盘访问密码:9987】
SpringBoot-redirect-301.zip
https://blog.xqlee.com/article/842.html