我不知道这是你的意思,但是这是你如何重定向
@Controller
public class PGPController {
@RequestMapping(value="/index.html", method=RequestMethod.GET)
public ModelAndView index(){
ModelAndView mv = new ModelAndView("index");
return mv;
}
@RequestMapping(value="/signin.html",method = RequestMethod.GET)
public ModelAndView submit){
ModelAndView mv = new ModelAndView("signin");
return mv;
}
@RequestMapping(value="/signin.html",method = RequestMethod.POST)
public ModelAndView submit(){
ModelAndView mv = new ModelAndView("redirect:signin.html");
return mv;
}
}
在示例中,所有POST请求以上signin.html将被重定向到signin.html。