<para>Some methods in the core classes of Spring Web MVC are marked
<literal>final</literal>. As a developer you cannot override these
methods to supply your own behavior. This has not been done arbitrarily, but
specifically with this principal in mind.</para>
specifically with this principal in mind.</para>
<para>For an explanation of this principle, refer to <emphasis>Expert
Spring Web MVC and Web Flow</emphasis> by Seth Ladd and others;
@ -326,8 +326,8 @@
@@ -326,8 +326,8 @@
</web-app></programlisting>
<para>With the above servlet configuration in place, <!--Is this something you need to do (in above example)? -->you
will need to have a file called <literal>/WEB-INF/<emphasis
role="bold">golfing</emphasis>-servlet.xml</literal> in your application;
will need to have a file called <literal>/WEB-INF/</literal><emphasis
role="bold">golfing</emphasis><literal>-servlet.xml</literal> in your application;
this file will contain all of your Spring Web MVC-specific components
(beans). You can change the exact location of this configuration file
through a servlet initialization parameter (see below for details).
@ -451,14 +451,14 @@
@@ -451,14 +451,14 @@
in the process to resolve the locale to use when processing the
request (rendering the view, preparing data, and so on). If you do not
need locale resolving, you do not need it.</para>
<!--Reword 'if you don't need local resolving, you dont need to use it '. Are you saying locale resolving is optional? If you don't configure it, will this step occur?-->
<!--Reword 'if you don't need local resolving, you dont need to use it '. Are you saying locale resolving is optional? If you don't configure it, will this step occur?-->
</listitem>
<listitem>
<para>The theme resolver is bound to the request to let elements such
as views determine which theme to use. If you do not use themes, you
can ignore it.</para>
<!-- MLP perhaps say that there are not side effect to this binding.etc... Clarify *ignore it*. Does this step still occur if you don't use themes? --><!--And what if you DO use themes, what do you do and when? Same question re locale resolving.-->
<!-- MLP perhaps say that there are not side effect to this binding.etc... Clarify *ignore it*. Does this step still occur if you don't use themes? --><!--And what if you DO use themes, what do you do and when? Same question re locale resolving.-->
</listitem>
<listitem>
@ -482,7 +482,7 @@
@@ -482,7 +482,7 @@
returned, (may be due to a preprocessor or postprocessor
intercepting the request, perhaps for security reasons), no view is
rendered, because the request could already have been fulfilled.</para>
<!--fulfilled how and by what?-->
<!--fulfilled how and by what?-->
</listitem>
</orderedlist>
@ -546,7 +546,7 @@
@@ -546,7 +546,7 @@
(using a comma as a delimiter) to support multiple contexts. In
case of multiple context locations with beans that are defined
twice, the latest location takes precedence.</entry>
<!-- MLP review -->
<!-- MLP review -->
</row>
<row>
@ -586,7 +586,7 @@
@@ -586,7 +586,7 @@
<emphasis>PetClinic</emphasis> sample, a web application that leverages
the annotation support described in this section, in the context of
simple form processing. The <emphasis>PetClinic</emphasis> application
resides in the <literal>samples/petclinic</literal> directory.</para>
resides in the <literal>org.springframework.samples.petclinic</literal> module.</para>
<!-- MLP Note removed reference to imagedb -->
</tip>
@ -598,7 +598,7 @@ public class HelloWorldController {
@@ -598,7 +598,7 @@ public class HelloWorldController {
@RequestMapping("/helloWorld")
public ModelAndView helloWorld() {
ModelAndView mac = new ModelAndView();
ModelAndView mav = new ModelAndView();
mav.setViewName("helloWorld");
mav.addObject("message", "Hello World!");
return mav;
@ -624,7 +624,7 @@ public class HelloWorldController {
@@ -624,7 +624,7 @@ public class HelloWorldController {
indicates that a particular class serves the role of a
<emphasis>controller</emphasis>. Spring does not require you to extend
any controller base class or reference the Servlet API. However, you can
still reference Servlet-specific features if you need to do so.</para>
still reference Servlet-specific features if you need to.</para>
<para>The <interfacename>@Controller</interfacename> annotation acts as
a stereotype for the annotated class, indicating its role. The
@ -638,7 +638,7 @@ public class HelloWorldController {
@@ -638,7 +638,7 @@ public class HelloWorldController {
for autodetection, aligned with Spring general support for detecting
component classes in the classpath and auto-registering bean definitions
for them.</para>
<!-- MLP Bev.changed to 'also supports autodetection -->
<!-- MLP Bev.changed to 'also supports autodetection -->
<para>To enable autodetection of such annotated controllers, you add
component scanning to your configuration. Use the
<emphasis>spring-context</emphasis> schema as shown in the following XML
@ -668,21 +668,20 @@ public class HelloWorldController {
@@ -668,21 +668,20 @@ public class HelloWorldController {
<para>You use the <interfacename>@RequestMapping</interfacename>
annotation to map URLs such as <filename>/appointments</filename> onto
an entire class or a particular handler method. You can use it to
annotate both a class and a method. Typically the class-level annotation
an entire class or a particular handler method. Typically the class-level annotation
maps a specific request path (or path pattern) onto a form controller,
with additional method-level annotations narrowing the primary mapping
for a specific HTTP method request method ("GET"/"POST") or specific
HTTP request parameters.</para>
<para>The following example shows a controller from the PetClinic sample
application that uses this annotation:</para>
<para>The following example shows a controller in a JSF application
@ -933,10 +933,11 @@ public class RelativePathUriTemplateController {
@@ -933,10 +933,11 @@ public class RelativePathUriTemplateController {
public void addPet(Pet pet, @PathVariable String ownerId) {
// implementation omitted
}
}
</programlisting> In the above example, the <methodname>addPet</methodname> is
only invoked when the content-type is in the <literal>text/*</literal>
range, for example, <literal>text/xml</literal>.</para>
}</programlisting>
<para>In the above example, the <methodname>addPet()</methodname> method is
only invoked when the <literal>content-type</literal> matches the <literal>text/*</literal>
pattern, for example, <literal>text/xml</literal>.</para>
</section>
<sectionid="mvc-ann-requestmapping-arguments">
@ -945,13 +946,14 @@ public class RelativePathUriTemplateController {
@@ -945,13 +946,14 @@ public class RelativePathUriTemplateController {
<para>Handler methods that are annotated with
<classname>@RequestMapping</classname> can have very flexible
signatures. They may have arguments of the following types, in
arbitrary order. (except for validation results, which need to follow
right after the corresponding command object, if desired<!--Reword preceding sentence to clarify, make it a complete sentence and no parentheses: first it says validation results *must*--><!--immediately follow command object, but then it says *if desired*. Clarify what must happen if what is desired. And are validation --><!-- results a type of argument? Relate to the sentence that precedes it.-->):
arbitrary order (except for validation results, which need to follow
right after the corresponding command object, if desired):
<!--Reword preceding sentence to clarify, make it a complete sentence and no parentheses: first it says validation results *must*--><!--immediately follow command object, but then it says *if desired*. Clarify what must happen if what is desired. And are validation --><!-- results a type of argument? Relate to the sentence that precedes it.-->
<itemizedlist>
<listitem>
<para>Request and/or response objects (Servlet API). Choose any
specific request/response type, for example,
<interfacename>ServletRequest</interfacename>/
<para>Request or response objects (Servlet API). Choose any
for access to the request HTTP body. Parameter values are
for access to the HTTP request body. Parameter values are
converted to the declared method argument type using
<interfacename>HttpMessageConverter</interfacename>s. See <xref
linkend="mvc-ann-requestbody" />.</para>
@ -1047,7 +1049,7 @@ public class RelativePathUriTemplateController {
@@ -1047,7 +1049,7 @@ public class RelativePathUriTemplateController {
<literal>webBindingInitializer</literal> property on
<classname>AnnotationMethodHandlerAdapter</classname>. Such
command objects along with their validation results will be
exposed as model attributes by default., using the non-qualified
exposed as model attributes by default, using the non-qualified
command class name in property notation. <!--Who or what uses the non-qualified class name in property notation? Is this something you have to set up?-->For
example, "orderAddress" for type "mypackage.OrderAddress".
Specify a parameter-level <classname>ModelAttribute</classname>
@ -1059,7 +1061,7 @@ public class RelativePathUriTemplateController {
@@ -1059,7 +1061,7 @@ public class RelativePathUriTemplateController {
@ -2197,15 +2200,15 @@ public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter {
@@ -2197,15 +2200,15 @@ public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter {
<programlistinglanguage="java">@Controller
public class ContentController {
private List<SampleContent> contentList = new ArrayList<SampleContent>();
private List<SampleContent> contentList = new ArrayList<SampleContent>();