我写了以下代码:
@Controller
@RequestMapping("something")
public class somethingController {
@RequestMapping(value="/someUrl",method=RequestMethod.POST)
public String myFunc(HttpServletRequest request,HttpServletResponse response,Map model){
//do sume stuffs
return "redirect:/anotherUrl"; //gets redirected to the url '/anotherUrl'
}
@RequestMapping(value="/anotherUrl",method=RequestMethod.POST)
public String myAnotherFunc(HttpServletRequest request,HttpServletResponse response){
//do sume stuffs
return "someView";
}
}
我如何能够重定向到请求方法为 POST 的“anotherUrl”请求映射?