diff --git a/spring-framework-reference/src/mvc.xml b/spring-framework-reference/src/mvc.xml
index 5c3369b49d5cb0318e88f9bc54ca1106f9a8771b..4ae264f64b9dfad9b49833372b99df2b1c5b5a3f 100644
--- a/spring-framework-reference/src/mvc.xml
+++ b/spring-framework-reference/src/mvc.xml
@@ -341,7 +341,7 @@
Consider the following DispatcherServlet
servlet configuration (in the 'web.xml' file.)
- <web-app>
+ <web-app>
<servlet>
<servlet-name>golfing</servlet-name>
@@ -613,7 +613,7 @@
org.springframework.web.servlet.mvc.Controller
interface, the source code for which is listed below.
- public interface Controller {
+ public interface Controller {
/**
* Process the request and return a ModelAndView object which the DispatcherServlet
@@ -731,7 +731,7 @@
consisting of a class and a declaration in the web application
context.
- package samples;
+ package samples;
public class SampleController extends AbstractController {
@@ -745,7 +745,7 @@ public class SampleController extends AbstractController {
}
}
- <bean id="sampleController" class="samples.SampleController">
+ <bean id="sampleController" class="samples.SampleController">
<property name="cacheSeconds" value="120"/>
</bean>
@@ -843,18 +843,18 @@ public [ModelAndView | Map | void] anyMeaningfulName(HttpServletRequest, HttpSer
The standard signature (mirrors the
Controller interface method).
- public ModelAndView displayCatalog(HttpServletRequest, HttpServletResponse)
+ public ModelAndView displayCatalog(HttpServletRequest, HttpServletResponse)
This signature accepts a Login argument
that will be populated (bound) with parameters retrieved from the
request.
- public ModelAndView login(HttpServletRequest, HttpServletResponse, Login)
+ public ModelAndView login(HttpServletRequest, HttpServletResponse, Login)
This signature requires that the request already have a valid
session.
- public ModelAndView viewCart(HttpServletRequest, HttpServletResponse, HttpSession)
+ public ModelAndView viewCart(HttpServletRequest, HttpServletResponse, HttpSession)
This signature accepts a Product argument
that will be populated (bound) with parameters retrieved from the
@@ -864,13 +864,13 @@ public [ModelAndView | Map | void] anyMeaningfulName(HttpServletRequest, HttpSer
always be the final argument (fourth when a session is specified, or
third otherwise).
- public ModelAndView updateCart(HttpServletRequest, HttpServletResponse, HttpSession, Product)
+ public ModelAndView updateCart(HttpServletRequest, HttpServletResponse, HttpSession, Product)
This signature has a void return type
indicating that the handler method assumes the responsibility of writing
the response.
- public void home(HttpServletRequest, HttpServletResponse)
+ public void home(HttpServletRequest, HttpServletResponse)
This signature has a Map return
type indicating that a view name translator will be responsible for
@@ -878,7 +878,7 @@ public [ModelAndView | Map | void] anyMeaningfulName(HttpServletRequest, HttpSer
consist of the Map's entries (see the
section entitled below).
- public Map list(HttpServletRequest, HttpServletResponse)
+ public Map list(HttpServletRequest, HttpServletResponse)
The MethodNameResolver is
responsible for resolving method names based on the specifics of the
@@ -944,13 +944,13 @@ public [ModelAndView | Map | void] anyMeaningfulName(HttpServletRequest, HttpSer
Exception. Here is an example signature for one
such Exception handling method.
- public ModelAndView processException(HttpServletRequest, HttpServletResponse, IllegalArgumentException)
+ public ModelAndView processException(HttpServletRequest, HttpServletResponse, IllegalArgumentException)
Let's look at an example showing the delegate-style of
MultiActionController usage in conjunction with
the ParameterMethodNameResolver.
- <bean id="paramMultiController"
+ <bean id="paramMultiController"
class="org.springframework.web.servlet.mvc.multiaction.MultiActionController">
<property name="methodNameResolver">
@@ -966,7 +966,7 @@ public [ModelAndView | Map | void] anyMeaningfulName(HttpServletRequest, HttpSer
</bean>
}
- public class SampleDelegate {
+ public class SampleDelegate {
public ModelAndView retrieveIndex(HttpServletRequest req, HttpServletResponse resp) {
return new ModelAndView("index", "date", new Long(System.currentTimeMillis()));
@@ -977,7 +977,7 @@ public [ModelAndView | Map | void] anyMeaningfulName(HttpServletRequest, HttpSer
PropertiesMethodNameResolver to match any number
couple of URLs to the method we defined:
- <bean id="propsResolver"
+ <bean id="propsResolver"
class="org....mvc.multiaction.PropertiesMethodNameResolver">
<property name="mappings">
<value>
@@ -1204,7 +1204,7 @@ public [ModelAndView | Map | void] anyMeaningfulName(HttpServletRequest, HttpSer
appropriate form Controller as
follows:
- <beans>
+ <beans>
<bean id="handlerMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
<bean name="/editaccount.form" class="org.springframework.web.servlet.mvc.SimpleFormController">
@@ -1222,7 +1222,7 @@ public [ModelAndView | Map | void] anyMeaningfulName(HttpServletRequest, HttpSer
web.xml as well, to let through all the requests
ending with .form.
- <web-app>
+ <web-app>
...
<servlet>
<servlet-name>sample</servlet-name>
@@ -1258,7 +1258,7 @@ public [ModelAndView | Map | void] anyMeaningfulName(HttpServletRequest, HttpSer
org.springframework.util.PathMatcher class). Here
is an example:
- <web-app>
+ <web-app>
...
<servlet>
<servlet-name>sample</servlet-name>
@@ -1284,7 +1284,7 @@ public [ModelAndView | Map | void] anyMeaningfulName(HttpServletRequest, HttpSer
all requests ending with .html and .form to be
handled by the sample dispatcher servlet.
- <beans>
+ <beans>
<!-- no 'id' required, HandlerMapping beans are automatically detected by the DispatcherServlet -->
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
@@ -1354,7 +1354,7 @@ public [ModelAndView | Map | void] anyMeaningfulName(HttpServletRequest, HttpSer
requests and reroutes the user to a specific page if the time is not
between 9 a.m. and 6 p.m.
- <beans>
+ <beans>
<bean id="handlerMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="interceptors">
@@ -1377,7 +1377,7 @@ public [ModelAndView | Map | void] anyMeaningfulName(HttpServletRequest, HttpSer
</bean>
<beans>
- package samples;
+ package samples;
public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter {
@@ -1542,7 +1542,7 @@ public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter {
translates a view name to a URL and hands the request over to the
RequestDispatcher to render the view.
- <bean id="viewResolver"
+ <bean id="viewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/jsp/"/>
@@ -1557,7 +1557,7 @@ public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter {
When mixing different view technologies in a web application, you
can use the ResourceBundleViewResolver:
- <bean id="viewResolver"
+ <bean id="viewResolver"
class="org.springframework.web.servlet.view.ResourceBundleViewResolver">
<property name="basename" value="views"/>
<property name="defaultParentView" value="parentView"/>
@@ -1601,7 +1601,7 @@ public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter {
Excel views (which are not supported by the
InternalResourceViewResolver):
- <bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
+ <bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
@@ -1801,7 +1801,7 @@ public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter {
below an example of defining a
CookieLocaleResolver.
- <bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
+ <bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="cookieName" value="clientlanguage"/>
@@ -1884,7 +1884,7 @@ public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter {
on the LocaleResolver that also exists in
the context).
- <bean id="localeChangeInterceptor"
+ <bean id="localeChangeInterceptor"
class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="siteLanguage"/>
</bean>
@@ -1959,7 +1959,7 @@ background=/themes/cool/img/coolBg.jpg
fragment uses the theme defined above to customize the look and
feel:
- <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
+ <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<html>
<head>
<link rel="stylesheet" href="<spring:theme code="styleSheet"/>" type="text/css"/>
@@ -2079,7 +2079,7 @@ background=/themes/cool/img/coolBg.jpg
The following example shows how to use the
CommonsMultipartResolver:
- <bean id="multipartResolver"
+ <bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- one of the properties available; the maximum file size in bytes -->
@@ -2089,7 +2089,7 @@ background=/themes/cool/img/coolBg.jpg
This is an example using the
CosMultipartResolver:
- <bean id="multipartResolver" class="org.springframework.web.multipart.cos.CosMultipartResolver">
+ <bean id="multipartResolver" class="org.springframework.web.multipart.cos.CosMultipartResolver">
<!-- one of the properties available; the maximum file size in bytes -->
<property name="maxUploadSize" value="100000"/>
@@ -2124,7 +2124,7 @@ background=/themes/cool/img/coolBg.jpg
Spring bind the file onto your form (backing object). To actually let
the user upload a file, we have to create a (HTML) form:
- <html>
+ <html>
<head>
<title>Upload a file please</title>
</head>
@@ -2159,7 +2159,7 @@ background=/themes/cool/img/coolBg.jpg
resolver, a url mapping to a controller that will process the bean, and
the controller itself.
- <beans>
+ <beans>
<!-- lets use the Commons-based implementation of the MultipartResolver interface -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>
@@ -2183,7 +2183,7 @@ background=/themes/cool/img/coolBg.jpg
After that, create the controller and the actual class to hold the
file property.
- public class FileUploadController extends SimpleFormController {
+ public class FileUploadController extends SimpleFormController {
protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response,
Object command, BindException errors) throws ServletException, IOException {
@@ -2235,7 +2235,7 @@ public class FileUploadBean {
An equivalent example in which a file is bound straight to a
String-typed property on a (form backing) object might look like:
- public class FileUploadController extends SimpleFormController {
+ public class FileUploadController extends SimpleFormController {
protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response,
Object command, BindException errors) throws ServletException, IOException {
@@ -2286,7 +2286,7 @@ public class FileUploadBean {
register any custom PropertyEditor
because there is no type conversion to be performed.
- public class FileUploadController extends SimpleFormController {
+ public class FileUploadController extends SimpleFormController {
protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response,
Object command, BindException errors) throws ServletException, IOException {
@@ -2379,7 +2379,7 @@ public class FileUploadBean {
Controller implementation. Take especial
notice of the name of the class.
- public class ViewShoppingCartController implements Controller {
+ public class ViewShoppingCartController implements Controller {
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) {
// the implementation is not hugely important for this example...
@@ -2389,7 +2389,7 @@ public class FileUploadBean {
Here is a snippet from the attendent Spring Web MVC configuration
file...
- <bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"/>
+ <bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"/>
<bean id="viewShoppingCart" class="x.y.z.ViewShoppingCartController">
<!-- inject dependencies as required... -->
@@ -2484,7 +2484,7 @@ public class FileUploadBean {
objects are added to the ModelAndView without any
associated name being specified.
- public class DisplayShoppingCartController implements Controller {
+ public class DisplayShoppingCartController implements Controller {
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) {
@@ -2612,7 +2612,7 @@ public class FileUploadBean {
request URLs to logical view names in a fashion that is probably best
explained by recourse to an example.
- public class RegistrationController implements Controller {
+ public class RegistrationController implements Controller {
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) {
// process the request...
@@ -2623,7 +2623,7 @@ public class FileUploadBean {
}
}
- <?xml version="1.0" encoding="UTF-8"?>
+ <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
"http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
@@ -2734,7 +2734,7 @@ public class FileUploadBean {
and/or AnnotationMethodHandlerAdapter is defined as well
- provided that you intend to use @RequestMapping.
- <?xml version="1.0" encoding="UTF-8"?>
+ <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
@@ -2784,7 +2784,7 @@ public class FileUploadBean {
the spring-context schema as shown in the following
XML snippet:
- <?xml version="1.0" encoding="UTF-8"?>
+ <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
@@ -2832,7 +2832,7 @@ public class FileUploadBean {
The following is an example of a form controller from the
PetClinic sample application using this annotation:
- @Controller
+ @Controller
@RequestMapping("/editPet.do")
@SessionAttributes("pet")
public class EditPetForm {
@@ -2878,7 +2878,7 @@ public class EditPetForm {
PetClinic sample application using
@RequestMapping:
- @Controller
+ @Controller
public class ClinicController {
private final Clinic clinic;
@@ -3125,7 +3125,7 @@ public class ClinicController {
The following code snippet from the PetClinic sample application
shows the usage:
- @Controller
+ @Controller
@RequestMapping("/editPet.do")
@SessionAttributes("pet")
public class EditPetForm {
@@ -3182,7 +3182,7 @@ public class EditPetForm {
The following code snippet shows these two usages of this
annotation:
- @Controller
+ @Controller
@RequestMapping("/editPet.do")
@SessionAttributes("pet")
public class EditPetForm {
@@ -3224,7 +3224,7 @@ public class EditPetForm {
The following code snippet shows the usage of this
annotation:
- @Controller
+ @Controller
@RequestMapping("/editPet.do")
@SessionAttributes("pet")
public class EditPetForm {
@@ -3241,7 +3241,7 @@ public class EditPetForm {
Let us consider that the following cookie has been received with an http request:
JSESSIONID=415A4AC178C59DACE0B2C9CA727CDD84
The following code sample allows you to easily get the value of the "JSESSIONID"cookie:
- @RequestMapping("/displayHeaderInfo.do")
+ @RequestMapping("/displayHeaderInfo.do")
public void displayHeaderInfo(@CookieValue("JSESSIONID") String cookie) {
//...
@@ -3266,7 +3266,7 @@ Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
]]>
The following code sample allows you to easily get the value of the "Accept-Encoding" and "Keep-Alive" headers:
- @RequestMapping("/displayHeaderInfo.do")
+ @RequestMapping("/displayHeaderInfo.do")
public void displayHeaderInfo(@RequestHeader("Accept-Encoding") String encoding,
@RequestHeader("Keep-Alive") long keepAlive) {
@@ -3314,7 +3314,7 @@ Keep-Alive 300
CustomDateEditor for all
java.util.Date form properties.
- @Controller
+ @Controller
public class MyFormController {
@InitBinder
@@ -3346,7 +3346,7 @@ public class MyFormController {
which configures PropertyEditors required by several of the PetClinic
controllers.
- <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
+ <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="cacheSeconds" value="0" />
<property name="webBindingInitializer">
<bean class="org.springframework.samples.petclinic.web.ClinicBindingInitializer" />
diff --git a/spring-framework-reference/src/portlet.xml b/spring-framework-reference/src/portlet.xml
index 57df1bed24c485e34218557cd058a91ce17037d1..8fdca5371f5ca9ef67eef1580acbde7a35522773 100644
--- a/spring-framework-reference/src/portlet.xml
+++ b/spring-framework-reference/src/portlet.xml
@@ -140,7 +140,7 @@
DispatcherPortlet is declared in the
portlet.xml of your web application:
-
+
sample
org.springframework.web.portlet.DispatcherPortlet
@@ -353,7 +353,7 @@
web.xml file for your web application as
follows:
-
+
ViewRendererServlet
org.springframework.web.servlet.ViewRendererServlet
@@ -407,7 +407,7 @@
org.springframework.web.portlet.mvc.Controller
interface, which is listed below.
- Here is short example consisting of a class and a declaration
in the web application context.
- Portlet as a
Controller as follows:
-
+
@@ -745,7 +745,7 @@ public class SampleController extends AbstractController {
based on the current mode of the portlet (e.g. ‘view’, ‘edit’,
‘help’). An example:
-
+