@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; }