* Process the request and return a ModelAndView object which the DispatcherServlet
@ -731,7 +731,7 @@
@@ -731,7 +731,7 @@
consisting of a class and a declaration in the web application
context.</para>
<programlisting>package samples;
<programlistinglanguage="java">package samples;
public class SampleController extends AbstractController {
@ -745,7 +745,7 @@ public class SampleController extends AbstractController {
@@ -745,7 +745,7 @@ public class SampleController extends AbstractController {
all requests ending with .html and <literal>.form</literal> to be
handled by the sample dispatcher servlet.</para>
<programlisting><beans>
<programlistinglanguage="xml"><beans>
<lineannotation><!-- no <literal>'id'</literal> required, <interfacename>HandlerMapping</interfacename> beans are automatically detected by the <classname>DispatcherServlet</classname> --></lineannotation>
public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter {
@ -1542,7 +1542,7 @@ 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
@ -1557,7 +1557,7 @@ public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter {
@@ -1557,7 +1557,7 @@ public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter {
<para>When mixing different view technologies in a web application, you
can use the <classname>ResourceBundleViewResolver</classname>:</para>
@ -1601,7 +1601,7 @@ public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter {
@@ -1601,7 +1601,7 @@ public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter {
@ -1801,7 +1801,7 @@ public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter {
@@ -1801,7 +1801,7 @@ public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter {
@ -1884,7 +1884,7 @@ public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter {
@@ -1884,7 +1884,7 @@ public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter {
on the <interfacename>LocaleResolver</interfacename> that also exists in
@ -647,7 +647,7 @@ public class SampleController extends AbstractController {
@@ -647,7 +647,7 @@ public class SampleController extends AbstractController {
instantiate an existing <interfacename>Portlet</interfacename> as a
<interfacename>Controller</interfacename> as follows:</para>
@ -745,7 +745,7 @@ public class SampleController extends AbstractController {
@@ -745,7 +745,7 @@ public class SampleController extends AbstractController {
based on the current mode of the portlet (e.g. ‘view’, ‘edit’,
@ -771,7 +771,7 @@ public class SampleController extends AbstractController {
@@ -771,7 +771,7 @@ public class SampleController extends AbstractController {
<para>The bean configuration for this mapping will look something
@ -804,7 +804,7 @@ public class SampleController extends AbstractController {
@@ -804,7 +804,7 @@ public class SampleController extends AbstractController {
<para>The bean configuration for this mapping will look something
@ -992,7 +992,7 @@ public class SampleController extends AbstractController {
@@ -992,7 +992,7 @@ public class SampleController extends AbstractController {
]]><lineannotation><!-- one of the properties available; the maximum file size in bytes --></lineannotation><![CDATA[
@ -1035,7 +1035,7 @@ public class SampleController extends AbstractController {
@@ -1035,7 +1035,7 @@ public class SampleController extends AbstractController {
actually let the user upload a file, we have to create a (JSP/HTML)
form:</para>
<programlisting><![CDATA[<h1>Please upload a file</h1>
<programlistinglanguage="xml"><![CDATA[<h1>Please upload a file</h1>
@ -1064,7 +1064,7 @@ public class SampleController extends AbstractController {
@@ -1064,7 +1064,7 @@ public class SampleController extends AbstractController {
resolver, a mapping to a controller that will process the bean, and
@ -1084,7 +1084,7 @@ public class SampleController extends AbstractController {
@@ -1084,7 +1084,7 @@ public class SampleController extends AbstractController {
<para>After that, create the controller and the actual class to hold
the file property.</para>
<programlisting><![CDATA[public class FileUploadController extends SimpleFormController {
<programlistinglanguage="java"><![CDATA[public class FileUploadController extends SimpleFormController {
public void onSubmitAction(ActionRequest request, ActionResponse response,
@ -1847,7 +1847,7 @@ pdf.class=pdf.HomePage</programlisting> <emphasis>If you want to start with a
@@ -1847,7 +1847,7 @@ pdf.class=pdf.HomePage</programlisting> <emphasis>If you want to start with a
<para>Here's the complete listing for our POI Excel view which displays
the word list from the model map in consecutive rows of the first
column of a new spreadsheet.. <programlisting>package excel;
column of a new spreadsheet.. <programlistinglanguage="java">package excel;
// imports omitted for brevity
@ -1883,7 +1883,7 @@ public class HomePage extends AbstractExcelView {
@@ -1883,7 +1883,7 @@ public class HomePage extends AbstractExcelView {
}
}</programlisting></para>
<para>And this a view generating the same Excel file, now using JExcelApi: <programlisting>package excel;
<para>And this a view generating the same Excel file, now using JExcelApi: <programlistinglanguage="java">package excel;
// imports omitted for brevity
@ -1927,7 +1927,7 @@ public class HomePage extends AbstractExcelView {
@@ -1927,7 +1927,7 @@ public class HomePage extends AbstractExcelView {
The <ulinkurl="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/web/context/support/WebApplicationContextUtils.html"><classname>WebApplicationContextUtils</classname></ulink>
class is for convenience, so you don't have to remember the name of the
@ -188,7 +188,7 @@
@@ -188,7 +188,7 @@
element and a <literal><variable-resolver/></literal> element within it.
The value of the variable resolver should reference Spring's
<classname>DelegatingVariableResolver</classname>; for example:</para>
@ -776,7 +776,7 @@ public class MyEngine extends org.apache.tapestry.engine.BaseEngine {
@@ -776,7 +776,7 @@ public class MyEngine extends org.apache.tapestry.engine.BaseEngine {
instance should be used for this Tapestry application, with an entry
in the Tapestry application definition file. For example:
@ -794,7 +794,7 @@ public class MyEngine extends org.apache.tapestry.engine.BaseEngine {
@@ -794,7 +794,7 @@ public class MyEngine extends org.apache.tapestry.engine.BaseEngine {
need out of the <interfacename>ApplicationContext</interfacename>,
and create page or component properties for them. For example:
@ -807,7 +807,7 @@ public class MyEngine extends org.apache.tapestry.engine.BaseEngine {
@@ -807,7 +807,7 @@ public class MyEngine extends org.apache.tapestry.engine.BaseEngine {
initial value for the property, as a bean obtained from the context.
@ -857,7 +857,7 @@ public class MyEngine extends org.apache.tapestry.engine.BaseEngine {
@@ -857,7 +857,7 @@ public class MyEngine extends org.apache.tapestry.engine.BaseEngine {
for the properties we have defined (in order to be able to
access the properties).
</para>
<programlisting><![CDATA[// our UserService implementation; will come from page definition
<programlistinglanguage="java"><![CDATA[// our UserService implementation; will come from page definition
public abstract UserService getUserService();
// our AuthenticationService implementation; will come from page definition
public abstract AuthenticationService getAuthenticationService();]]></programlisting>
@ -865,7 +865,7 @@ public abstract AuthenticationService getAuthenticationService();]]></programlis
@@ -865,7 +865,7 @@ public abstract AuthenticationService getAuthenticationService();]]></programlis
For the sake of completeness, the entire Java class, for a