in the Spring MVC Showcase example dowlodable from the STS dashboard
I have some doubt about the following situation:
In my view I have the following link:
<li>
<a id="responseEntityStatus" class="textLink" href="<c:url value="/response/entity/status" />">ResponseEntity (custom status)</a>
</li>
This link generate an HTTP Request towards the URL: "/response/entity/status"
This URL is handled by the following method of a @Controller class named ResponseController (which in turn is annotated with @RequestMapping(value="/response", method=RequestMethod.GET) )
The method thath handled the previus HTTP Request is:
@RequestMapping("/entity/status")
public ResponseEntity<String> responseEntityStatusCode() {
return new ResponseEntity<String>("The String ResponseBody with custom status code (403 Forbidden)",
HttpStatus.FORBIDDEN);
}
This method return a ResponseEntity object and, reading the documentation, I understand that returning a setted ResponseEntity objct is substantially the same thing as a return a @ResponseBody String object
So, in my particular case, I am returning a ResponseEntity object (that rappresent my HTTP Response) in wicht I have setted the
HTTP RESPONSE Body field with the String The String ResponseBody with custom status code (403 Forbidden)
I have not setted Headers fields
I have setted the HTTP Status status code to HttpStatus.FORBIDDEN
Now, I have read that this HttpStatus is a field of ResponseEntity class but I have not understand what this object exactly rappresent...
So what rappresent the HttpStatus object? and what mean if it is setted to FORBIDDEN?