方法一:
@RequestMapping("/go1")
public String go1(){
return "redirect:" + url;
}
方法二:
@RequestMapping("/go2")
public ModelAndView go2(){
return new ModelAndView("redirect:" + url);
}
方法三:
@RequestMapping("/go3")
public void go3(HttpServletResponse response){
try {
response.sendRedirect(url);
} catch (IOException e) {
e.printStackTrace();
}
}
网友评论