Is that possible to use same url in request mapping for two different post method, only request body differs.
Yes you can do that but you need to specify unique parameters signature in RequestMapping annotation:
public class MyController {
@RequestMapping(method = RequestMethod.POST, params = {"!name", "!name2"})
public String action(HttpServletRequest request, HttpServletResponse response){
// body
}
@RequestMapping(method = RequestMethod.POST, params = "name")
public String action(HttpServletRequest request, HttpServletResponse response,
@RequestParam(value = "name", required = true) String name) {
// body
}
}
`