I have a controller like so,
@RequestMapping(value = "/sample")
public ResponseEntity<> search() throws Exception{
return new ResponseEntity("Hello World",OK);
}
This works fine, but when I dont use ResponseEntity for returning the result but return the String instead, it does not work,
@RequestMapping(value = "/sample")
public String search() throws Exception{
return "Hello Worls";
}
This does not work and I get a 404! Any help greatly appreciated
Use
ReponseBody
annotation: