Skip to content

Commit f18520d

Browse files
author
eugenp
committed
update operation fix
1 parent c1fed77 commit f18520d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-security-rest-full/src/main/java/org/baeldung/web/controller/FooController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ public void create(@RequestBody final Foo resource, final HttpServletResponse re
8585
eventPublisher.publishEvent(new ResourceCreatedEvent(this, response, idOfCreatedResource));
8686
}
8787

88-
@RequestMapping(method = RequestMethod.PUT)
88+
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
8989
@ResponseStatus(HttpStatus.OK)
90-
public void update(@RequestBody final Foo resource) {
90+
public void update(@PathVariable("id") final Long id, @RequestBody final Foo resource) {
9191
Preconditions.checkNotNull(resource);
9292
RestPreconditions.checkFound(service.findOne(resource.getId()));
9393
service.update(resource);

0 commit comments

Comments
 (0)