Browse Source

SPR-5724: Documentation for RESTful webservice examples slightly incorrect for 3.0.0.M3

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1155 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/head
Arjen Poutsma 17 years ago
parent
commit
022f8ed39c
  1. 10
      spring-framework-reference/src/rest.xml

10
spring-framework-reference/src/rest.xml

@ -75,7 +75,7 @@ @@ -75,7 +75,7 @@
variable. A Spring controller method to process above example is shown
below;</para>
<programlisting language="java">@RequestMapping("/users/{userid}", method=RequestMethod.GET)
<programlisting language="java">@RequestMapping(value="/users/{userid}", method=RequestMethod.GET)
public String getUser(@PathVariable String userId) {
// implementation omitted...
}</programlisting>
@ -93,7 +93,7 @@ public String getUser(@PathVariable String userId) { @@ -93,7 +93,7 @@ public String getUser(@PathVariable String userId) {
<para>The following code snippet shows the use of a single
<classname>@PathVariable</classname> in a controller method:</para>
<programlisting language="java">@RequestMapping("/owners/{ownerId}", method=RequestMethod.GET)
<programlisting language="java">@RequestMapping(value="/owners/{ownerId}", method=RequestMethod.GET)
public String findOwner(<emphasis role="bold">@PathVariable</emphasis> String ownerId, Model model) {
Owner owner = ownerService.findOwner(ownerId);
model.addAttribute("owner", owner);
@ -114,7 +114,7 @@ public String findOwner(<emphasis role="bold">@PathVariable</emphasis> String ow @@ -114,7 +114,7 @@ public String findOwner(<emphasis role="bold">@PathVariable</emphasis> String ow
name of the URI Template variable name to bind to in the @PathVariable
annotation. For example</para>
<programlisting language="java">@RequestMapping("/owners/{ownerId}", method=RequestMethod.GET)
<programlisting language="java">@RequestMapping(value="/owners/{ownerId}", method=RequestMethod.GET)
public String findOwner(<emphasis role="bold">@PathVariable</emphasis>("ownerId") String ownerId, Model model) {
// implementation omitted
}
@ -124,7 +124,7 @@ public String findOwner(<emphasis role="bold">@PathVariable</emphasis>("ownerId" @@ -124,7 +124,7 @@ public String findOwner(<emphasis role="bold">@PathVariable</emphasis>("ownerId"
so you may also use a controller method with the signature shown
below</para>
<programlisting language="java">@RequestMapping("/owners/{ownerId}", method=RequestMethod.GET)
<programlisting language="java">@RequestMapping(value="/owners/{ownerId}", method=RequestMethod.GET)
public String findOwner(<emphasis role="bold">@PathVariable</emphasis>("ownerId") String theOwner, Model model) {
// implementation omitted
}</programlisting>
@ -132,7 +132,7 @@ public String findOwner(<emphasis role="bold">@PathVariable</emphasis>("ownerId" @@ -132,7 +132,7 @@ public String findOwner(<emphasis role="bold">@PathVariable</emphasis>("ownerId"
<para>Multiple @PathVariable annotations can be used to bind to
multiple URI Template variables as shown below:</para>
<programlisting language="java">@RequestMapping("/owners/{ownerId}/pets/{petId}", method=RequestMethod.GET)
<programlisting language="java">@RequestMapping(value="/owners/{ownerId}/pets/{petId}", method=RequestMethod.GET)
public String findPet(<emphasis role="bold">@PathVariable</emphasis> String ownerId, <emphasis
role="bold">@PathVariable</emphasis> String petId, Model model) {
Owner owner = ownerService.findOwner(ownderId);

Loading…
Cancel
Save