@ -1723,7 +1723,7 @@ To trigger validation of a `@Controller` input, simply annotate the input argume
@@ -1723,7 +1723,7 @@ To trigger validation of a `@Controller` input, simply annotate the input argume
public String findOwner(**@PathVariable** String ownerId, Model model) {
Owner owner = ownerService.findOwner(ownerId);
model.addAttribute("owner", owner);
@ -717,7 +717,7 @@ template variable by name. You can specify it in the annotation:
@@ -717,7 +717,7 @@ template variable by name. You can specify it in the annotation:
public String findOwner(**@PathVariable("ownerId")** String theOwner, Model model) {
// implementation omitted
}
@ -730,7 +730,7 @@ will match the method argument name to the URI template variable name:
@@ -730,7 +730,7 @@ will match the method argument name to the URI template variable name:
public String findOwner(**@PathVariable** String ownerId, Model model) {
// implementation omitted
}
@ -742,7 +742,7 @@ A method can have any number of `@PathVariable` annotations:
@@ -742,7 +742,7 @@ A method can have any number of `@PathVariable` annotations:
public String findPet(**@PathVariable** String ownerId, **@PathVariable** String petId, Model model) {
Owner owner = ownerService.findOwner(ownerId);
Pet pet = owner.getPet(petId);
@ -886,7 +886,7 @@ Below is an example of extracting the matrix variable "q":
@@ -886,7 +886,7 @@ Below is an example of extracting the matrix variable "q":
public void findPet(@PathVariable String petId, @MatrixVariable int q) {
// petId == 42
@ -903,10 +903,10 @@ specific to identify where the variable is expected to be:
@@ -903,10 +903,10 @@ specific to identify where the variable is expected to be:
@MatrixVariable(value="q", pathVar="ownerId") int q1,
@MatrixVariable(value="q", pathVar="petId") int q2) {
@MatrixVariable(name="q", pathVar="ownerId") int q1,
@MatrixVariable(name="q", pathVar="petId") int q2) {
// q1 == 11
// q2 == 22
@ -921,7 +921,7 @@ A matrix variable may be defined as optional and a default value specified:
@@ -921,7 +921,7 @@ A matrix variable may be defined as optional and a default value specified:
Type conversion is applied automatically if the target method parameter type is not
`String`. See <<mvc-ann-typeconversion>>.
@ -1320,7 +1320,7 @@ be bound to the value of the HTTP request body. For example:
@@ -1320,7 +1320,7 @@ be bound to the value of the HTTP request body. For example:
public void handle(@RequestBody String body, Writer writer) throws IOException {
writer.write(body);
}
@ -1399,7 +1399,7 @@ response body (and not placed in a Model, or interpreted as a view name). For ex
@@ -1399,7 +1399,7 @@ response body (and not placed in a Model, or interpreted as a view name). For ex
public String processSubmit(**@ModelAttribute Pet pet**) { }
----
@ -1568,7 +1568,7 @@ using an URI template variable and a type converter. Here is an example:
@@ -1568,7 +1568,7 @@ using an URI template variable and a type converter. Here is an example:
@ -2758,7 +2758,7 @@ through `Model` nor `RedirectAttributes`. For example:
@@ -2758,7 +2758,7 @@ through `Model` nor `RedirectAttributes`. For example:
@ -3542,7 +3542,7 @@ use `MultipartHttpServletRequest` or `MultipartFile` in the method parameters:
@@ -3542,7 +3542,7 @@ use `MultipartHttpServletRequest` or `MultipartFile` in the method parameters:
public String onSubmit(**@RequestPart("meta-data") MetaData metadata,
@RequestPart("file-data") MultipartFile file**) {
@ -3840,7 +3840,7 @@ When writing error information, the status code and the error message set on the
@@ -3840,7 +3840,7 @@ When writing error information, the status code and the error message set on the