Heuristic Method Matching
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 |
Not shown is the possibility that other attribute name/value pairs may follow the /-id/ field or a blank /-/ field.
POST /inventory/album/-/id/Thriller/artist/Michael Jackson/genre/pop
GET /inventory/album/-Thriller
POST /inventory/album/-Thriller/released/1984-12-01
POST /inventory/album/-Thriller
Note that whether PUT maps to create or update varies by source.
Heuristic Result Matching
- (on "success") my-resource-$method (e.g., -create, -read, -update, -delete, -index, -input, -other)
- my-resource-$result-code (e.g., "success", "cancel", "input", "error")
- $result-code
- my-resource
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.
Heuristic Action Matching
- MyResource
- MyResourceAction
- My.resource
- MyAction.resource
- my-resource/Index
- or the package default (ActionSupport)
Settings
- base.action.packages (action)
- base.result.location (/WEB-INF/result)
- create.method (create), read.method (read), update.method (update), delete.method (delete), welcome.method (index)
- action.name.separator (-)