Apache Struts 2 Plugin Registry > Home > REST Plugin > RESTful CRUD for HTML methods |
Action | SQL | REST Verb | HTML Method | URI | Invokes | Parameters | Notes |
---|---|---|---|---|---|---|---|
Create | Insert | PUT | POST | /my-resource | MyResource.create | ... | |
Read | Select | GET | GET | /my-resource/-id | MyResource.read | ... | aka FindbyId |
Update | Update | POST | POST | /my-resource/-id | MyResource.update | id="id", ... | with one or more POST attributes |
Delete | Delete | DELETE | POST | /my-resource/-id | MyResource.delete | id="id" | with zero POST attributes (or single delete attribute ) |
Welcome | Describe | n/a | GET | /my-resource | MyResource.index | ... | |
Input for Create | n/a | n/a | GET | /my-resource-input | MyResource.input | ... | |
Input for Update | n/a | n/a | GET | /my-resource-input/-id | MyResource.input | id="id", ... | |
Other State Read | n/a | n/a | GET | /my-resource-other(/-id) | MyResource.other | ... | |
Other State Change | n/a | n/a | POST | /my-resource-other(/-id) | MyResource.other | ... |
Key
"..." | indicates that there may be other attributes passed through the POST or GET request |
"-id" | is the action.name.separator followed by the value of the primary identifier for the resource (/album/-Thriller) |
Not shown is the possibility that other attribute name/value pairs may follow the /-id/ field or a blank /-/ field.
Note that whether PUT maps to create or update varies by source.
An "extension" to result matching would be to map default result-type to suffixes added to result codes. For example, a result code like "success.ftl" would utilize the FreeMarker result.