diff --git a/spring-framework-reference/src/portlet.xml b/spring-framework-reference/src/portlet.xml index 2e3affbd30..f55371141b 100644 --- a/spring-framework-reference/src/portlet.xml +++ b/spring-framework-reference/src/portlet.xml @@ -1020,7 +1020,7 @@ public class SampleController extends AbstractController { DispatcherPortlet detects a multipart request, it activates the resolver that has been declared in your context and hands over the request. What the resolver then does is - wrap the current ActionRequest into a + wrap the current ActionRequest in a MultipartActionRequest that has support for multipart file uploads. Using the MultipartActionRequest you can get @@ -1039,7 +1039,8 @@ public class SampleController extends AbstractController { After the PortletMultipartResolver has finished doing its job, the request will be processed like any other. To use - it, you create a form with an upload field (see immediately below), + the PortletMultipartResolver, create + a form with an upload field (see example below), then let Spring bind the file onto your form (backing object). To actually let the user upload a file, we have to create a (JSP/HTML) form: @@ -1050,8 +1051,8 @@ public class SampleController extends AbstractController { ]]> - As you can see, we've created a field named “file” after the - property of the bean that holds the byte[]. + As you can see, we've created a field named “file” that matches the + property of the bean that holds the byte[] array. Furthermore we've added the encoding attribute (enctype="multipart/form-data"), which is necessary to let the browser know how to encode the multipart fields @@ -1064,10 +1065,10 @@ public class SampleController extends AbstractController { of editors available for handling files and setting the results on an object. There's a StringMultipartFileEditor capable of - converting files to Strings (using a user-defined character set) and + converting files to Strings (using a user-defined character set), and there is a ByteArrayMultipartFileEditor which - converts files to byte arrays. They function just as the - CustomDateEditor does. + converts files to byte arrays. They function analogous to the + CustomDateEditor. So, to be able to upload files using a form, declare the resolver, a mapping to a controller that will process the bean, and @@ -1133,7 +1134,7 @@ public class FileUploadBean { }]]> As you can see, the FileUploadBean has - a property typed byte[] that holds the file. The + a property of type byte[] that holds the file. The controller registers a custom editor to let Spring know how to actually convert the multipart objects the resolver has found to properties specified by the bean. In this example, nothing is done @@ -1142,7 +1143,7 @@ public class FileUploadBean { mail it to somebody, etc). An equivalent example in which a file is bound straight to a - String-typed property on a (form backing) object might look like + String-typed property on a form backing object might look like this: Handling exceptions - Just like Web MVC, Portlet MVC provides + Just like Servlet MVC, Portlet MVC provides HandlerExceptionResolvers to ease the - pain of unexpected exceptions occurring while your request is being + pain of unexpected exceptions that occur while your request is being processed by a handler that matched the request. Portlet MVC also - provides the same concrete + provides a portlet-specific, concrete SimpleMappingExceptionResolver that enables you to take the class name of any exception that might be thrown and map it to a view name. @@ -1245,7 +1246,7 @@ public class FileUploadBean {
Annotation-based controller configuration - Spring 2.5 introduces an annotation-based programming model for MVC + Spring 2.5 introduced an annotation-based programming model for MVC controllers, using annotations such as @RequestMapping, @RequestParam, @@ -1256,6 +1257,12 @@ public class FileUploadBean { direct dependencies on Servlet or Portlet API's, although they can easily get access to Servlet or Portlet facilities if desired. + + The following sections document these annotations and how they are most commonly used in a Portlet environment.