update operation fix

This commit is contained in:
eugenp 2014-06-19 12:56:34 +03:00
parent c1fed77c54
commit f18520d30d
1 changed files with 2 additions and 2 deletions

View File

@ -85,9 +85,9 @@ public class FooController {
eventPublisher.publishEvent(new ResourceCreatedEvent(this, response, idOfCreatedResource));
}
@RequestMapping(method = RequestMethod.PUT)
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
@ResponseStatus(HttpStatus.OK)
public void update(@RequestBody final Foo resource) {
public void update(@PathVariable("id") final Long id, @RequestBody final Foo resource) {
Preconditions.checkNotNull(resource);
RestPreconditions.checkFound(service.findOne(resource.getId()));
service.update(resource);