complete the template src/main/resources/templates/barista/Controller.java
add methods for a BREAD on a given resource foo, following REST uniform interface (note: the controller here should be annotated with @Controller and not @RestController):
browse:GET: /foosdescription: get a view of all foo resources
read:GET: /foos/{id}description: get a view of the foo resource identified by id
edit:GET: /foos/{id}/editdescription: get a form to edit the foo resource identified by id
update:PUT: /foos/{id}description: store the modified foo resource and return a redirection to its read endpoint
add:GET: /foos/adddescription: get a form to create a new foo resource
store:POST: /foosdescription: store the new foo resource and return a redirection to its read endpoint
destroy:DELETE: /foos/{id}description: delete the foo resource identified by id, and return a redirection to /foos
complete the template src/main/resources/templates/barista/Controller.java
add methods for a BREAD on a given resource
foo
, following REST uniform interface (note: the controller here should be annotated with@Controller
and not@RestController
):browse:
GET: /foos
description: get a view of all foo resourcesread:
GET: /foos/{id}
description: get a view of the foo resource identified byid
edit:
GET: /foos/{id}/edit
description: get a form to edit the foo resource identified byid
update:
PUT: /foos/{id}
description: store the modified foo resource and return a redirection to its read endpointadd:
GET: /foos/add
description: get a form to create a new foo resourcestore:
POST: /foos
description: store the new foo resource and return a redirection to its read endpointdestroy:
DELETE: /foos/{id}
description: delete the foo resource identified byid
, and return a redirection to/foos