diff --git a/spring-framework-reference/src/rest.xml b/spring-framework-reference/src/rest.xml index 9d3fcf5af6e..a2fec76face 100644 --- a/spring-framework-reference/src/rest.xml +++ b/spring-framework-reference/src/rest.xml @@ -75,7 +75,7 @@ variable. A Spring controller method to process above example is shown below; - @RequestMapping("/users/{userid}", method=RequestMethod.GET) + @RequestMapping(value="/users/{userid}", method=RequestMethod.GET) public String getUser(@PathVariable String userId) { // implementation omitted... } @@ -93,7 +93,7 @@ public String getUser(@PathVariable String userId) { The following code snippet shows the use of a single @PathVariable in a controller method: - @RequestMapping("/owners/{ownerId}", method=RequestMethod.GET) + @RequestMapping(value="/owners/{ownerId}", method=RequestMethod.GET) public String findOwner(@PathVariable String ownerId, Model model) { Owner owner = ownerService.findOwner(ownerId); model.addAttribute("owner", owner); @@ -114,7 +114,7 @@ public String findOwner(@PathVariable String ow name of the URI Template variable name to bind to in the @PathVariable annotation. For example - @RequestMapping("/owners/{ownerId}", method=RequestMethod.GET) + @RequestMapping(value="/owners/{ownerId}", method=RequestMethod.GET) public String findOwner(@PathVariable("ownerId") String ownerId, Model model) { // implementation omitted } @@ -124,7 +124,7 @@ public String findOwner(@PathVariable("ownerId" so you may also use a controller method with the signature shown below - @RequestMapping("/owners/{ownerId}", method=RequestMethod.GET) + @RequestMapping(value="/owners/{ownerId}", method=RequestMethod.GET) public String findOwner(@PathVariable("ownerId") String theOwner, Model model) { // implementation omitted } @@ -132,7 +132,7 @@ public String findOwner(@PathVariable("ownerId" Multiple @PathVariable annotations can be used to bind to multiple URI Template variables as shown below: - @RequestMapping("/owners/{ownerId}/pets/{petId}", method=RequestMethod.GET) + @RequestMapping(value="/owners/{ownerId}/pets/{petId}", method=RequestMethod.GET) public String findPet(@PathVariable String ownerId, @PathVariable String petId, Model model) { Owner owner = ownerService.findOwner(ownderId);