I have written the following code:
@Controller
@RequestMapping(\"something\")
public class somethingControll
A spring Controller methods can be both POST and GET requests.
In your scenario:
@RequestMapping(value="/anotherUrl",method=RequestMethod.POST)
public String myAnotherFunc(HttpServletRequest request,HttpServletResponse response){
//do sume stuffs
return "someView";
}
You want this GET because you are redirecting to it. Hence your solution will be
@RequestMapping(value="/anotherUrl", method = { RequestMethod.POST, RequestMethod.GET })
public String myAnotherFunc(HttpServletRequest request,HttpServletResponse response){
//do sume stuffs
return "someView";
}
Caution : here, if your method accepts some request parameters by @requestParam,then while redirecting you must pass them.
Simply all attributes required by this method must send while redirecting...
Thank You.