From b38d022b848362c858b3cb85f9bbd409de2edde6 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Thu, 29 Sep 2011 16:48:34 +0000 Subject: [PATCH] Fixed broken link to non-existent mvc-multipart-resolver ID. --- spring-framework-reference/src/mvc.xml | 68 +++++++++++++------------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/spring-framework-reference/src/mvc.xml b/spring-framework-reference/src/mvc.xml index 3f75114caea..407b289d3dd 100644 --- a/spring-framework-reference/src/mvc.xml +++ b/spring-framework-reference/src/mvc.xml @@ -90,10 +90,10 @@ - Clear separation of roles. Each role -- + Clear separation of roles. Each role — controller, validator, command object, form object, model object, DispatcherServlet, handler mapping, view - resolver, and so on -- can be fulfilled by a specialized + resolver, and so on — can be fulfilled by a specialized object. @@ -468,9 +468,9 @@ If you specify a multipart file resolver, the request is inspected for multiparts; if multiparts are found, the request is wrapped in a MultipartHttpServletRequest for - further processing by other elements in the process. (See for further information about - multipart handling). + further processing by other elements in the process. See for further information about + multipart handling. @@ -1552,7 +1552,7 @@ public void populateModel(@RequestParam String number, Model model) { the return value of the @RequestMapping method is interpreted as a model attribute rather than as a view name. The view name is derived from view name conventions instead much like for methods - returning void -- see . + returning void — see . @@ -1581,15 +1581,15 @@ public String processSubmit(@ModelAttribute Pet pet - It may already be in the model due to use of + It may already be in the model due to use of @SessionAttributes - -- see . - It may already be in the model due to an + — see . + It may already be in the model due to an @ModelAttribute method in the same - controller -- as explained in the previous section. - It may be retrieved based on a URI template variable - and type converter (explained in more detail below). - It may be instantiated using its default constructor. + controller — as explained in the previous section. + It may be retrieved based on a URI template variable + and type converter (explained in more detail below). + It may be instantiated using its default constructor. An @ModelAttribute method is a common @@ -1613,8 +1613,8 @@ public String save(@ModelAttribute("account") Account account) { @ModelAttribute method. The next step is data binding. The WebDataBinder - class matches request parameter names -- including query string parameters and - form fields -- to model attribute fields by name. Matching fields are populated + class matches request parameter names — including query string parameters and + form fields — to model attribute fields by name. Matching fields are populated after type conversion (from String to the target field type) has been applied where necessary. Data binding and validation are covered in . @@ -2408,7 +2408,7 @@ public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter { <property name="location" value="/WEB-INF/views.xml"/> </bean> -<!-- in views.xml --> +<!— in views.xml --> <beans> <bean name="report" class="org.springframework.example.ReportExcelView"/> @@ -2758,7 +2758,7 @@ public class ContentController { Flash attributes provide a way for one request to store attributes intended for use in another. This is most commonly needed when redirecting - -- e.g. the Post/Redirect/Get pattern. Flash attributes are saved temporarily + — e.g. the Post/Redirect/Get pattern. Flash attributes are saved temporarily before the redirect (typically in the session) to be made available to the request after the redirect and removed immediately. @@ -3266,7 +3266,7 @@ public class FileUpoadController { a RESTful service scenario. All of the above examples and configuration apply here as well. However, unlike browsers that typically submit files and simple form fields, a programmatic client can also send more complex - data of a specific content type -- for exmaple a multipart request with + data of a specific content type — for example a multipart request with a file and second part with JSON formatted data: POST /someUrl @@ -3287,14 +3287,14 @@ Content-Transfer-Encoding: 8bit ... File Data ... - You could access the part named "meta-data" with + You could access the part named "meta-data" with a @RequestParam("meta-data") String metadata controller method argument. However, you would probably prefer to accept a strongly typed object initialized from the JSON formatted data in the body of the request part, very similar to the way @RequestBody converts - the body of a non-multipart requests to a target object + the body of a non-multipart request to a target object with the help of an HttpMessageConverter. You can use the @RequestPart @@ -3303,23 +3303,22 @@ Content-Transfer-Encoding: 8bit content of a specific multipart passed through an HttpMessageConverter taking into consideration the 'Content-Type' - header of the multipart: - -@RequestMapping(value="/someUrl", method = RequestMethod.POST) + header of the multipart: + + @RequestMapping(value="/someUrl", method = RequestMethod.POST) public String onSubmit(@RequestPart("meta-data") MetaData metadata, - @RequestPart("file-data") MultipartFile file,) { + @RequestPart("file-data") MultipartFile file) { // ... -} - +} - Notice how you MultipartFile + Notice how MultipartFile method arguments can be accessed with @RequestParam or with @RequestPart interchangeably. However, the @RequestPart("meta-data") MetaData method argument in this case is read as JSON content based on its 'Content-Type' - header and converted with help of the + header and converted with the help of the MappingJacksonHttpMessageConverter. @@ -3331,8 +3330,7 @@ public String onSubmit(@RequestPart("meta-data") MetaData Handling exceptions
- <interfacename>HandlerExceptionResolver</interfacename> + <interfacename>HandlerExceptionResolver</interfacename> Spring HandlerExceptionResolver implementations deal with unexpected exceptions that occur during controller execution. @@ -3473,7 +3471,7 @@ public class SimpleController { should you choose to move forward with it into production. Convention-over-configuration support addresses the three core areas - of MVC -- models, views, and controllers. + of MVC — models, views, and controllers.
The Controller @@ -3902,26 +3900,26 @@ public class SimpleController { <listitem> <para><classname>Jaxb2RootElementHttpMessageConverter</classname> - converts Java objects to/from XML -- added if JAXB2 is present + converts Java objects to/from XML — added if JAXB2 is present on the classpath. </para> </listitem> <listitem> <para><classname>MappingJacksonHttpMessageConverter</classname> - converts to/from JSON -- added if Jackson is present on the classpath. + converts to/from JSON — added if Jackson is present on the classpath. </para> </listitem> <listitem> <para><classname>AtomFeedHttpMessageConverter</classname> - converts Atom feeds -- added if Rome is present on the classpath. + converts Atom feeds — added if Rome is present on the classpath. </para> </listitem> <listitem> <para><classname>RssChannelHttpMessageConverter</classname> - converts RSS feeds -- added if Rome is present on the classpath. + converts RSS feeds — added if Rome is present on the classpath. </para> </listitem> </itemizedlist>