concept PUT in category java

appears as: PUT
Spring Roo in Action

This is an excerpt from Manning's book Spring Roo in Action.

You’ve seen for things like the update and remove operations that the tags look like they’re issuing PUT and DELETE operations. However, in general, web browsers can only operate on several operations: GET, OPTIONS, POST, and HEAD being the main ones. PUT and DELETE are operations defined by the HTTP RFC. However, you’ll notice you’re mapping all of your operations to the other operations, such as RequestMethod.DELETE. How does Roo identify these?

The reason this works is because Roo uses a HiddenHttpMethodFilter. This method looks for an HTTP request parameter named _method, which is set to the desired HTTP method such as GET, POST, PUT, and DELETE. Spring MVC then converts these GET and POST requests internally to PUT and DELETE requests based on that field.