How do I get a Spring 3.0 controller to trigger a 404?
I have a controller with @RequestMapping(value = \"/**\", method = RequestMethod.GET) and for som
Also if you want to return 404 status from your controller all you need is to do this
@RequestMapping(value = "/somthing", method = RequestMethod.POST)
@ResponseBody
public HttpStatus doSomthing(@RequestBody String employeeId) {
try{
return HttpStatus.OK;
}
catch(Exception ex){
return HttpStatus.NOT_FOUND;
}
}
By doing this you will receive a 404 error in case when you want to return a 404 from your controller.