http://git-wip-us.apache.org/repos/asf/struts-site/blob/b16cc4ef/content/docs/interceptors.html
----------------------------------------------------------------------
diff --git a/content/docs/interceptors.html b/content/docs/interceptors.html
index 0118889..d90cd72 100644
--- a/content/docs/interceptors.html
+++ b/content/docs/interceptors.html
@@ -34,20 +34,6 @@ under the License.
color: #666;
}
</style>
- <link href='https://struts.apache.org/highlighter/style/shCoreStruts.css'
rel='stylesheet' type='text/css' />
- <link href='https://struts.apache.org/highlighter/style/shThemeStruts.css'
rel='stylesheet' type='text/css' />
- <script src='https://struts.apache.org/highlighter/js/shCore.js'
type='text/javascript'></script>
- <script src='https://struts.apache.org/highlighter/js/shBrushPlain.js'
type='text/javascript'></script>
- <script src='https://struts.apache.org/highlighter/js/shBrushXml.js'
type='text/javascript'></script>
- <script src='https://struts.apache.org/highlighter/js/shBrushJava.js'
type='text/javascript'></script>
- <script src='https://struts.apache.org/highlighter/js/shBrushJScript.js'
type='text/javascript'></script>
- <script src='https://struts.apache.org/highlighter/js/shBrushGroovy.js'
type='text/javascript'></script>
- <script src='https://struts.apache.org/highlighter/js/shBrushBash.js'
type='text/javascript'></script>
- <script src='https://struts.apache.org/highlighter/js/shBrushCss.js'
type='text/javascript'></script>
- <script type="text/javascript">
- SyntaxHighlighter.defaults['toolbar'] = false;
- SyntaxHighlighter.all();
- </script>
<script type="text/javascript" language="javascript">
var hide = null;
var show = null;
@@ -139,19 +125,7 @@ under the License.
<div class="pagecontent">
<div class="wiki-content">
- <div id="ConfluenceContent"><div
class="confluence-information-macro confluence-information-macro-tip"><span
class="aui-icon aui-icon-small aui-iconfont-approve
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>The default Interceptor stack is
designed to serve the needs of most applications. Most applications will
<strong>not</strong> need to add Interceptors or change the Interceptor
stack.</p></div></div><p>Many Actions share common concerns. Some Actions need
input validated. Other Actions may need a file upload to be pre-processed.
Another Action might need protection from a double submit. Many Actions need
drop-down lists and other controls pre-populated before the page
displays.</p><p>The framework makes it easy to share solutions to these
concerns using an "Interceptor" strategy. When you request a resource that maps
to an "action", the framework invokes the Action object. But, before the Action
is executed, the invocatio
n can be intercepted by another object. After the Action executes, the
invocation could be intercepted again. Unsurprisingly, we call these objects
"Interceptors."</p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1499928204372 {padding: 0px;}
-div.rbtoc1499928204372 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1499928204372 li {margin-left: 0px;padding-left: 0px;}
-
-/*]]>*/</style></p><div class="toc-macro rbtoc1499928204372">
-<ul class="toc-indentation"><li><a shape="rect"
href="#Interceptors-UnderstandingInterceptors">Understanding
Interceptors</a></li><li><a shape="rect"
href="#Interceptors-ConfiguringInterceptors">Configuring
Interceptors</a></li><li><a shape="rect"
href="#Interceptors-StackingInterceptors">Stacking Interceptors</a>
-<ul class="toc-indentation"><li><a shape="rect"
href="#Interceptors-TheDefaultConfiguration">The Default
Configuration</a></li></ul>
-</li><li><a shape="rect" href="#Interceptors-FrameworkInterceptors">Framework
Interceptors</a>
-<ul class="toc-indentation"><li><a shape="rect"
href="#Interceptors-MethodFiltering">Method Filtering</a></li><li><a
shape="rect" href="#Interceptors-InterceptorParameterOverriding">Interceptor
Parameter Overriding</a></li><li><a shape="rect"
href="#Interceptors-InterceptorParameterOverridingInheritance">Interceptor
Parameter Overriding Inheritance</a></li><li><a shape="rect"
href="#Interceptors-Lazyparameters">Lazy parameters</a></li><li><a shape="rect"
href="#Interceptors-OrderofInterceptorExecution">Order of Interceptor
Execution</a></li></ul>
-</li><li><a shape="rect" href="#Interceptors-FAQ">FAQ</a></li><li><a
shape="rect" href="#Interceptors-Next:">Next: Writing Interceptors</a></li></ul>
-</div><h2 id="Interceptors-UnderstandingInterceptors">Understanding
Interceptors</h2><p>Interceptors can execute code before and after an Action is
invoked. Most of the framework's core functionality is implemented as
Interceptors. Features like double-submit guards, type conversion, object
population, validation, file upload, page preparation, and more, are all
implemented with the help of Interceptors. Each and every Interceptor is
pluggable, so you can decide exactly which features an Action needs to
support.</p><p>Interceptors can be configured on a per-action basis. Your own
custom Interceptors can be mixed-and-matched with the Interceptors bundled with
the framework. Interceptors "set the stage" for the Action classes, doing much
of the "heavy lifting" before the Action executes.</p><div
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1"
rowspan="1" class="confluenceTh"><p>Action Lifecyle</p></th></tr><tr><td
colspan="1" rowspan="1" class="confluenceT
d"><p><span class="confluence-embedded-file-wrapper"><img
class="confluence-embedded-image"
src="interceptors.data/overview.png"></span></p></td></tr></tbody></table></div><p>In
some cases, an Interceptor might keep an Action from firing, because of a
double-submit or because validation failed. Interceptors can also change the
state of an Action before it executes.</p><p>The Interceptors are defined in a
stack that specifies the execution order. In some cases, the order of the
Interceptors on the stack can be very important.</p><h2
id="Interceptors-ConfiguringInterceptors">Configuring Interceptors</h2><div
class="code panel pdl" style="border-width: 1px;"><div class="codeHeader
panelHeader pdl" style="border-bottom-width: 1px;"><b>struts.xml</b></div><div
class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><package name="default" extends="struts-default">
+ <div id="ConfluenceContent"><rich-text-body><p>The default
Interceptor stack is designed to serve the needs of most applications. Most
applications will <strong>not</strong> need to add Interceptors or change the
Interceptor stack.</p></rich-text-body><p>Many Actions share common concerns.
Some Actions need input validated. Other Actions may need a file upload to be
pre-processed. Another Action might need protection from a double submit. Many
Actions need drop-down lists and other controls pre-populated before the page
displays.</p><p>The framework makes it easy to share solutions to these
concerns using an "Interceptor" strategy. When you request a resource that maps
to an "action", the framework invokes the Action object. But, before the Action
is executed, the invocation can be intercepted by another object. After the
Action executes, the invocation could be intercepted again. Unsurprisingly, we
call these objects "Interceptors."</p><p><parameter ac:name="minLevel">2
</parameter></p><h2 id="Interceptors-UnderstandingInterceptors">Understanding
Interceptors</h2><p>Interceptors can execute code before and after an Action is
invoked. Most of the framework's core functionality is implemented as
Interceptors. Features like double-submit guards, type conversion, object
population, validation, file upload, page preparation, and more, are all
implemented with the help of Interceptors. Each and every Interceptor is
pluggable, so you can decide exactly which features an Action needs to
support.</p><p>Interceptors can be configured on a per-action basis. Your own
custom Interceptors can be mixed-and-matched with the Interceptors bundled with
the framework. Interceptors "set the stage" for the Action classes, doing much
of the "heavy lifting" before the Action executes.</p><div
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1"
rowspan="1" class="confluenceTh"><p>Action Lifecyle</p></th></tr><tr><td
colspan="1" rowspan="1" class="c
onfluenceTd"><p><span class="confluence-embedded-file-wrapper"><img
class="confluence-embedded-image"
src="interceptors.data/overview.png"></span></p></td></tr></tbody></table></div><p>In
some cases, an Interceptor might keep an Action from firing, because of a
double-submit or because validation failed. Interceptors can also change the
state of an Action before it executes.</p><p>The Interceptors are defined in a
stack that specifies the execution order. In some cases, the order of the
Interceptors on the stack can be very important.</p><h2
id="Interceptors-ConfiguringInterceptors">Configuring
Interceptors</h2><parameter ac:name="">xml</parameter><parameter
ac:name="title">struts.xml</parameter><plain-text-body><package
name="default" extends="struts-default">
<interceptors>
<interceptor name="timer" class=".."/>
<interceptor name="logger" class=".."/>
@@ -164,9 +138,7 @@ div.rbtoc1499928204372 li {margin-left: 0px;padding-left:
0px;}
<result name="success"
type="redirectAction">/secure/home</result>
</action>
</package>
-</pre>
-</div></div><h2 id="Interceptors-StackingInterceptors">Stacking
Interceptors</h2><p>With most web applications, we find ourselves wanting to
apply the same set of Interceptors over and over again. Rather than reiterate
the same list of Interceptors, we can bundle these Interceptors together using
an Interceptor Stack.</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width:
1px;"><b>struts.xml</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><package name="default" extends="struts-default">
+</plain-text-body><h2 id="Interceptors-StackingInterceptors">Stacking
Interceptors</h2><p>With most web applications, we find ourselves wanting to
apply the same set of Interceptors over and over again. Rather than reiterate
the same list of Interceptors, we can bundle these Interceptors together using
an Interceptor Stack.</p><parameter ac:name="">xml</parameter><parameter
ac:name="title">struts.xml</parameter><plain-text-body><package
name="default" extends="struts-default">
<interceptors>
<interceptor name="timer" class=".."/>
<interceptor name="logger" class=".."/>
@@ -182,432 +154,7 @@ div.rbtoc1499928204372 li {margin-left: 0px;padding-left:
0px;}
<result name="success"
type="redirectAction">/secure/home</result>
</action>
</package>
-</pre>
-</div></div><p>Looking inside <code>struts-default.xml</code>, we can see how
it's done.</p><h3 id="Interceptors-TheDefaultConfiguration">The Default
Configuration</h3><p></p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default"
type="syntaxhighlighter"><![CDATA[
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
--->
-
-<!--
- When declaring beans in this file you must either use
name="struts" or don't name the bean at all.
-
- The name="struts" must be used when alias was defined in {@link
org.apache.struts2.config.DefaultBeanSelectionProvider} -
- it is then the default bean's name and {@link
org.apache.struts2.config.DefaultBeanSelectionProvider} links name
"struts"
- with "default" (aliasing it)
-
- If name won't be defined then the "default" value will be
used {@link com.opensymphony.xwork2.inject.Container#DEFAULT_NAME}
- and {@link com.opensymphony.xwork2.inject.Inject}
--->
-<!DOCTYPE struts PUBLIC
- "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
- "http://struts.apache.org/dtds/struts-2.5.dtd">
-
-<struts>
-
- <constant name="struts.excludedClasses"
- value="
- java.lang.Object,
- java.lang.Runtime,
- java.lang.System,
- java.lang.Class,
- java.lang.ClassLoader,
- java.lang.Shutdown,
- java.lang.ProcessBuilder,
- ognl.OgnlContext,
- ognl.ClassResolver,
- ognl.TypeConverter,
- ognl.MemberAccess,
- ognl.DefaultMemberAccess,
- com.opensymphony.xwork2.ognl.SecurityMemberAccess,
- com.opensymphony.xwork2.ActionContext" />
-
- <!-- this must be valid regex, each '.' in package name must be
escaped! -->
- <!-- it's more flexible but slower than simple string comparison
-->
- <!-- constant name="struts.excludedPackageNamePatterns"
value="^java\.lang\..*,^ognl.*,^(?!javax\.servlet\..+)(javax\..+)" /
-->
-
- <!-- this is simpler version of the above used with string comparison
-->
- <constant name="struts.excludedPackageNames"
- value="
- java.lang.,
- ognl.,
- javax,
- freemarker.core.,
- freemarker.template.,
- freemarker.ext.rhino.,
- freemarker.ext.beans.,
- sun.reflect.,
- javassist." />
-
- <bean class="com.opensymphony.xwork2.ObjectFactory"
name="struts"/>
- <bean type="com.opensymphony.xwork2.factory.ResultFactory"
name="struts"
class="org.apache.struts2.factory.StrutsResultFactory" />
- <bean type="com.opensymphony.xwork2.factory.ActionFactory"
name="struts"
class="com.opensymphony.xwork2.factory.DefaultActionFactory" />
- <bean type="com.opensymphony.xwork2.factory.ConverterFactory"
name="struts"
class="com.opensymphony.xwork2.factory.DefaultConverterFactory" />
- <bean
type="com.opensymphony.xwork2.factory.InterceptorFactory"
name="struts"
class="com.opensymphony.xwork2.factory.DefaultInterceptorFactory"
/>
- <bean type="com.opensymphony.xwork2.factory.ValidatorFactory"
name="struts"
class="com.opensymphony.xwork2.factory.DefaultValidatorFactory" />
- <bean
type="com.opensymphony.xwork2.factory.UnknownHandlerFactory"
name="struts"
class="com.opensymphony.xwork2.factory.DefaultUnknownHandlerFactory"
/>
-
- <bean type="com.opensymphony.xwork2.FileManager"
class="com.opensymphony.xwork2.util.fs.DefaultFileManager"
name="system" scope="singleton"/>
- <bean type="com.opensymphony.xwork2.FileManagerFactory"
class="com.opensymphony.xwork2.util.fs.DefaultFileManagerFactory"
name="struts" scope="singleton"/>
-
- <bean type="com.opensymphony.xwork2.ActionProxyFactory"
name="struts"
class="org.apache.struts2.factory.StrutsActionProxyFactory"/>
- <bean type="com.opensymphony.xwork2.ActionProxyFactory"
name="prefix"
class="org.apache.struts2.factory.PrefixBasedActionProxyFactory"/>
-
- <bean
type="com.opensymphony.xwork2.conversion.ObjectTypeDeterminer"
name="struts"
class="com.opensymphony.xwork2.conversion.impl.DefaultObjectTypeDeterminer"/>
-
- <bean type="com.opensymphony.xwork2.util.PatternMatcher"
name="struts"
class="com.opensymphony.xwork2.util.WildcardHelper" />
- <bean type="com.opensymphony.xwork2.util.PatternMatcher"
name="namedVariable"
class="com.opensymphony.xwork2.util.NamedVariablePatternMatcher"/>
- <bean type="com.opensymphony.xwork2.util.PatternMatcher"
name="regex"
class="org.apache.struts2.util.RegexPatternMatcher"/>
-
- <bean type="org.apache.struts2.util.ContentTypeMatcher"
name="struts"
class="org.apache.struts2.util.DefaultContentTypeMatcher"/>
-
- <bean
type="org.apache.struts2.dispatcher.mapper.ActionMapper"
name="struts"
class="org.apache.struts2.dispatcher.mapper.DefaultActionMapper" />
- <bean
type="org.apache.struts2.dispatcher.mapper.ActionMapper"
name="composite"
class="org.apache.struts2.dispatcher.mapper.CompositeActionMapper"
/>
- <bean
type="org.apache.struts2.dispatcher.mapper.ActionMapper"
name="restful"
class="org.apache.struts2.dispatcher.mapper.RestfulActionMapper" />
- <bean
type="org.apache.struts2.dispatcher.mapper.ActionMapper"
name="restful2"
class="org.apache.struts2.dispatcher.mapper.Restful2ActionMapper"
/>
-
- <bean
type="org.apache.struts2.dispatcher.multipart.MultiPartRequest"
name="jakarta"
class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest"
scope="prototype"/>
- <bean
type="org.apache.struts2.dispatcher.multipart.MultiPartRequest"
name="jakarta-stream"
class="org.apache.struts2.dispatcher.multipart.JakartaStreamMultiPartRequest"
scope="prototype"/>
-
- <bean
type="org.apache.struts2.views.TagLibraryDirectiveProvider"
name="s" class="org.apache.struts2.views.DefaultTagLibrary"
/>
- <bean type="org.apache.struts2.views.TagLibraryModelProvider"
name="s" class="org.apache.struts2.views.DefaultTagLibrary"
/>
-
- <bean
class="org.apache.struts2.views.freemarker.FreemarkerThemeTemplateLoader"
/>
- <bean
class="org.apache.struts2.views.freemarker.FreemarkerManager"
name="struts" />
- <bean
class="org.apache.struts2.views.velocity.VelocityManager"
name="struts" optional="true" />
-
- <bean
class="org.apache.struts2.components.template.TemplateEngineManager"
/>
- <bean
type="org.apache.struts2.components.template.TemplateEngine"
name="ftl"
class="org.apache.struts2.components.template.FreemarkerTemplateEngine"
/>
- <bean
type="org.apache.struts2.components.template.TemplateEngine"
name="vm"
class="org.apache.struts2.components.template.VelocityTemplateEngine"
/>
- <bean
type="org.apache.struts2.components.template.TemplateEngine"
name="jsp"
class="org.apache.struts2.components.template.JspTemplateEngine" />
-
- <bean
type="com.opensymphony.xwork2.conversion.impl.XWorkConverter"
name="struts"
class="com.opensymphony.xwork2.conversion.impl.XWorkConverter" />
-
- <bean
type="com.opensymphony.xwork2.conversion.ConversionPropertiesProcessor"
name="struts"
class="com.opensymphony.xwork2.conversion.impl.DefaultConversionPropertiesProcessor"
/>
- <bean
type="com.opensymphony.xwork2.conversion.ConversionFileProcessor"
name="struts"
class="com.opensymphony.xwork2.conversion.impl.DefaultConversionFileProcessor"
/>
- <bean
type="com.opensymphony.xwork2.conversion.ConversionAnnotationProcessor"
name="struts"
class="com.opensymphony.xwork2.conversion.impl.DefaultConversionAnnotationProcessor"
/>
- <bean
type="com.opensymphony.xwork2.conversion.TypeConverterCreator"
name="struts"
class="com.opensymphony.xwork2.conversion.impl.DefaultTypeConverterCreator"
/>
- <bean
type="com.opensymphony.xwork2.conversion.TypeConverterHolder"
name="struts"
class="com.opensymphony.xwork2.conversion.impl.DefaultTypeConverterHolder"
/>
-
- <bean
class="com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter"
/>
-
- <bean
type="com.opensymphony.xwork2.conversion.impl.CollectionConverter"
name="struts"
class="com.opensymphony.xwork2.conversion.impl.CollectionConverter"
scope="singleton"/>
- <bean
type="com.opensymphony.xwork2.conversion.impl.ArrayConverter"
name="struts"
class="com.opensymphony.xwork2.conversion.impl.ArrayConverter"
scope="singleton"/>
- <bean
type="com.opensymphony.xwork2.conversion.impl.DateConverter"
name="struts"
class="com.opensymphony.xwork2.conversion.impl.DateConverter"
scope="singleton"/>
- <bean
type="com.opensymphony.xwork2.conversion.impl.NumberConverter"
name="struts"
class="com.opensymphony.xwork2.conversion.impl.NumberConverter"
scope="singleton"/>
- <bean
type="com.opensymphony.xwork2.conversion.impl.StringConverter"
name="struts"
class="com.opensymphony.xwork2.conversion.impl.StringConverter"
scope="singleton"/>
-
- <bean type="com.opensymphony.xwork2.LocalizedTextProvider"
name="global-only"
class="com.opensymphony.xwork2.util.GlobalLocalizedTextProvider"
scope="singleton" />
- <bean type="com.opensymphony.xwork2.LocalizedTextProvider"
name="struts"
class="com.opensymphony.xwork2.util.StrutsLocalizedTextProvider"
scope="singleton" />
-
- <bean type="com.opensymphony.xwork2.TextProvider"
name="system"
class="com.opensymphony.xwork2.DefaultTextProvider"
scope="singleton" />
- <bean type="com.opensymphony.xwork2.TextProviderFactory"
name="struts"
class="com.opensymphony.xwork2.StrutsTextProviderFactory"
scope="singleton" />
- <bean type="com.opensymphony.xwork2.LocaleProviderFactory"
name="struts"
class="com.opensymphony.xwork2.DefaultLocaleProviderFactory"
scope="singleton" />
-
- <bean type="org.apache.struts2.components.UrlRenderer"
name="struts"
class="org.apache.struts2.components.ServletUrlRenderer"/>
- <bean type="org.apache.struts2.views.util.UrlHelper"
name="struts"
class="org.apache.struts2.views.util.DefaultUrlHelper"/>
-
- <bean type="com.opensymphony.xwork2.util.ValueStackFactory"
name="struts"
class="com.opensymphony.xwork2.ognl.OgnlValueStackFactory" />
- <bean
type="com.opensymphony.xwork2.util.reflection.ReflectionProvider"
name="struts"
class="com.opensymphony.xwork2.ognl.OgnlReflectionProvider" />
- <bean
type="com.opensymphony.xwork2.util.reflection.ReflectionContextFactory"
name="struts"
class="com.opensymphony.xwork2.ognl.OgnlReflectionContextFactory"
/>
-
- <bean type="com.opensymphony.xwork2.conversion.NullHandler"
name="java.lang.Object"
class="com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler"
/>
-
- <bean
type="com.opensymphony.xwork2.validator.ActionValidatorManager"
name="struts"
class="com.opensymphony.xwork2.validator.AnnotationActionValidatorManager"
/>
- <bean
type="com.opensymphony.xwork2.validator.ActionValidatorManager"
name="no-annotations"
class="com.opensymphony.xwork2.validator.DefaultActionValidatorManager"
/>
-
- <bean
type="com.opensymphony.xwork2.validator.ValidatorFactory"
class="com.opensymphony.xwork2.validator.DefaultValidatorFactory"/>
- <bean
type="com.opensymphony.xwork2.validator.ValidatorFileParser"
class="com.opensymphony.xwork2.validator.DefaultValidatorFileParser"
/>
-
- <bean class="com.opensymphony.xwork2.ognl.OgnlUtil" />
-
- <bean type="com.opensymphony.xwork2.util.TextParser"
name="struts"
class="com.opensymphony.xwork2.util.OgnlTextParser"
scope="singleton"/>
-
- <bean type="ognl.PropertyAccessor"
name="com.opensymphony.xwork2.util.CompoundRoot"
class="com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor"
/>
- <bean type="ognl.PropertyAccessor"
name="java.lang.Object"
class="com.opensymphony.xwork2.ognl.accessor.ObjectAccessor" />
- <bean type="ognl.PropertyAccessor"
name="java.util.Iterator"
class="com.opensymphony.xwork2.ognl.accessor.XWorkIteratorPropertyAccessor"
/>
- <bean type="ognl.PropertyAccessor"
name="java.util.Enumeration"
class="com.opensymphony.xwork2.ognl.accessor.XWorkEnumerationAccessor"
/>
- <bean type="ognl.PropertyAccessor"
name="java.util.List"
class="com.opensymphony.xwork2.ognl.accessor.XWorkListPropertyAccessor"
/>
- <bean type="ognl.PropertyAccessor"
name="java.util.Set"
class="com.opensymphony.xwork2.ognl.accessor.XWorkCollectionPropertyAccessor"
/>
- <bean type="ognl.PropertyAccessor"
name="java.util.Map"
class="com.opensymphony.xwork2.ognl.accessor.XWorkMapPropertyAccessor"
/>
- <bean type="ognl.PropertyAccessor"
name="java.util.Collection"
class="com.opensymphony.xwork2.ognl.accessor.XWorkCollectionPropertyAccessor"
/>
- <bean type="ognl.PropertyAccessor"
name="com.opensymphony.xwork2.ognl.ObjectProxy"
class="com.opensymphony.xwork2.ognl.accessor.ObjectProxyPropertyAccessor"
/>
- <bean type="ognl.PropertyAccessor"
name="org.apache.struts2.dispatcher.HttpParameters"
class="com.opensymphony.xwork2.ognl.accessor.HttpParametersPropertyAccessor"
/>
- <bean type="ognl.PropertyAccessor"
name="org.apache.struts2.dispatcher.Parameter"
class="com.opensymphony.xwork2.ognl.accessor.ParameterPropertyAccessor"
/>
-
- <bean type="ognl.MethodAccessor"
name="java.lang.Object"
class="com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor"
/>
- <bean type="ognl.MethodAccessor"
name="com.opensymphony.xwork2.util.CompoundRoot"
class="com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor"
/>
-
- <bean class="org.apache.struts2.views.jsp.ui.OgnlTool" />
-
- <bean
type="org.apache.struts2.dispatcher.StaticContentLoader"
class="org.apache.struts2.dispatcher.DefaultStaticContentLoader"
name="struts" />
- <bean type="com.opensymphony.xwork2.UnknownHandlerManager"
class="com.opensymphony.xwork2.DefaultUnknownHandlerManager"
name="struts" />
-
- <bean
type="org.apache.struts2.dispatcher.DispatcherErrorHandler"
name="struts"
class="org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler"
/>
-
- <constant name="struts.dispatcher.errorHandler"
value="struts" />
-
- <!-- Silly workarounds for OGNL since there is currently no way to
flush its internal caches -->
- <bean type="ognl.PropertyAccessor"
name="java.util.ArrayList"
class="com.opensymphony.xwork2.ognl.accessor.XWorkListPropertyAccessor"
/>
- <bean type="ognl.PropertyAccessor"
name="java.util.HashSet"
class="com.opensymphony.xwork2.ognl.accessor.XWorkCollectionPropertyAccessor"
/>
- <bean type="ognl.PropertyAccessor"
name="java.util.HashMap"
class="com.opensymphony.xwork2.ognl.accessor.XWorkMapPropertyAccessor"
/>
-
- <bean
type="com.opensymphony.xwork2.security.ExcludedPatternsChecker"
name="struts"
class="com.opensymphony.xwork2.security.DefaultExcludedPatternsChecker"
scope="prototype" />
- <bean
type="com.opensymphony.xwork2.security.AcceptedPatternsChecker"
name="struts"
class="com.opensymphony.xwork2.security.DefaultAcceptedPatternsChecker"
scope="prototype" />
-
- <bean
type="com.opensymphony.xwork2.config.providers.ValueSubstitutor"
class="com.opensymphony.xwork2.config.providers.EnvsValueSubstitutor"
scope="singleton"/>
-
- <package name="struts-default" abstract="true"
strict-method-invocation="true">
- <result-types>
- <result-type name="chain"
class="com.opensymphony.xwork2.ActionChainResult"/>
- <result-type name="dispatcher"
class="org.apache.struts2.result.ServletDispatcherResult"
default="true"/>
- <result-type name="freemarker"
class="org.apache.struts2.views.freemarker.FreemarkerResult"/>
- <result-type name="httpheader"
class="org.apache.struts2.result.HttpHeaderResult"/>
- <result-type name="redirect"
class="org.apache.struts2.result.ServletRedirectResult"/>
- <result-type name="redirectAction"
class="org.apache.struts2.result.ServletActionRedirectResult"/>
- <result-type name="stream"
class="org.apache.struts2.result.StreamResult"/>
- <result-type name="velocity"
class="org.apache.struts2.result.VelocityResult"/>
- <result-type name="xslt"
class="org.apache.struts2.views.xslt.XSLTResult"/>
- <result-type name="plainText"
class="org.apache.struts2.result.PlainTextResult" />
- <result-type name="postback"
class="org.apache.struts2.result.PostbackResult" />
- </result-types>
-
- <interceptors>
- <interceptor name="alias"
class="com.opensymphony.xwork2.interceptor.AliasInterceptor"/>
- <interceptor name="autowiring"
class="com.opensymphony.xwork2.spring.interceptor.ActionAutowiringInterceptor"/>
- <interceptor name="chain"
class="com.opensymphony.xwork2.interceptor.ChainingInterceptor"/>
- <interceptor name="conversionError"
class="org.apache.struts2.interceptor.StrutsConversionErrorInterceptor"/>
- <interceptor name="cookie"
class="org.apache.struts2.interceptor.CookieInterceptor"/>
- <interceptor name="cookieProvider"
class="org.apache.struts2.interceptor.CookieProviderInterceptor"/>
- <interceptor name="clearSession"
class="org.apache.struts2.interceptor.ClearSessionInterceptor" />
- <interceptor name="createSession"
class="org.apache.struts2.interceptor.CreateSessionInterceptor" />
- <interceptor name="debugging"
class="org.apache.struts2.interceptor.debugging.DebuggingInterceptor"
/>
- <interceptor name="execAndWait"
class="org.apache.struts2.interceptor.ExecuteAndWaitInterceptor"/>
- <interceptor name="exception"
class="com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor"/>
- <interceptor name="fileUpload"
class="org.apache.struts2.interceptor.FileUploadInterceptor"/>
- <interceptor name="i18n"
class="org.apache.struts2.interceptor.I18nInterceptor"/>
- <interceptor name="logger"
class="com.opensymphony.xwork2.interceptor.LoggingInterceptor"/>
- <interceptor name="modelDriven"
class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>
- <interceptor name="scopedModelDriven"
class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"/>
- <interceptor name="params"
class="com.opensymphony.xwork2.interceptor.ParametersInterceptor"/>
- <interceptor name="actionMappingParams"
class="org.apache.struts2.interceptor.ActionMappingParametersInteceptor"/>
- <interceptor name="prepare"
class="com.opensymphony.xwork2.interceptor.PrepareInterceptor"/>
- <interceptor name="staticParams"
class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>
- <interceptor name="scope"
class="org.apache.struts2.interceptor.ScopeInterceptor"/>
- <interceptor name="servletConfig"
class="org.apache.struts2.interceptor.ServletConfigInterceptor"/>
- <interceptor name="timer"
class="com.opensymphony.xwork2.interceptor.TimerInterceptor"/>
- <interceptor name="token"
class="org.apache.struts2.interceptor.TokenInterceptor"/>
- <interceptor name="tokenSession"
class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/>
- <interceptor name="validation"
class="org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor"/>
- <interceptor name="workflow"
class="com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor"/>
- <interceptor name="store"
class="org.apache.struts2.interceptor.MessageStoreInterceptor" />
- <interceptor name="checkbox"
class="org.apache.struts2.interceptor.CheckboxInterceptor" />
- <interceptor name="datetime"
class="org.apache.struts2.interceptor.DateTextFieldInterceptor" />
- <interceptor name="profiling"
class="org.apache.struts2.interceptor.ProfilingActivationInterceptor"
/>
- <interceptor name="roles"
class="org.apache.struts2.interceptor.RolesInterceptor" />
- <interceptor name="annotationWorkflow"
class="com.opensymphony.xwork2.interceptor.annotations.AnnotationWorkflowInterceptor"
/>
- <interceptor name="multiselect"
class="org.apache.struts2.interceptor.MultiselectInterceptor" />
- <interceptor name="noop"
class="org.apache.struts2.interceptor.NoOpInterceptor" />
-
- <!-- Empty stack - performs no operations -->
- <interceptor-stack name="emptyStack">
- <interceptor-ref name="noop"/>
- </interceptor-stack>
-
- <!-- Basic stack -->
- <interceptor-stack name="basicStack">
- <interceptor-ref name="exception"/>
- <interceptor-ref name="servletConfig"/>
- <interceptor-ref name="prepare"/>
- <interceptor-ref name="checkbox"/>
- <interceptor-ref name="datetime"/>
- <interceptor-ref name="multiselect"/>
- <interceptor-ref name="actionMappingParams"/>
- <interceptor-ref name="params"/>
- <interceptor-ref name="conversionError"/>
- </interceptor-stack>
-
- <!-- Sample validation and workflow stack -->
- <interceptor-stack name="validationWorkflowStack">
- <interceptor-ref name="basicStack"/>
- <interceptor-ref name="validation"/>
- <interceptor-ref name="workflow"/>
- </interceptor-stack>
-
- <!-- Sample file upload stack -->
- <interceptor-stack name="fileUploadStack">
- <interceptor-ref name="fileUpload"/>
- <interceptor-ref name="basicStack"/>
- </interceptor-stack>
-
- <!-- Sample model-driven stack -->
- <interceptor-stack name="modelDrivenStack">
- <interceptor-ref name="modelDriven"/>
- <interceptor-ref name="basicStack"/>
- </interceptor-stack>
-
- <!-- Sample action chaining stack -->
- <interceptor-stack name="chainStack">
- <interceptor-ref name="chain"/>
- <interceptor-ref name="basicStack"/>
- </interceptor-stack>
-
- <!-- Sample i18n stack -->
- <interceptor-stack name="i18nStack">
- <interceptor-ref name="i18n"/>
- <interceptor-ref name="basicStack"/>
- </interceptor-stack>
-
- <!-- An example of the paramsPrepareParams trick. This stack
- is exactly the same as the defaultStack, except that it
- includes one extra interceptor before the prepare interceptor:
- the params interceptor.
-
- This is useful for when you wish to apply parameters directly
- to an object that you wish to load externally (such as a DAO
- or database or service layer), but can't load that object
- until at least the ID parameter has been loaded. By loading
- the parameters twice, you can retrieve the object in the
- prepare() method, allowing the second params interceptor to
- apply the values on the object. -->
- <interceptor-stack name="paramsPrepareParamsStack">
- <interceptor-ref name="exception"/>
- <interceptor-ref name="alias"/>
- <interceptor-ref name="i18n"/>
- <interceptor-ref name="checkbox"/>
- <interceptor-ref name="datetime"/>
- <interceptor-ref name="multiselect"/>
- <interceptor-ref name="params"/>
- <interceptor-ref name="servletConfig"/>
- <interceptor-ref name="prepare"/>
- <interceptor-ref name="chain"/>
- <interceptor-ref name="modelDriven"/>
- <interceptor-ref name="fileUpload"/>
- <interceptor-ref name="staticParams"/>
- <interceptor-ref name="actionMappingParams"/>
- <interceptor-ref name="params"/>
- <interceptor-ref name="conversionError"/>
- <interceptor-ref name="validation">
- <param
name="excludeMethods">input,back,cancel,browse</param>
- </interceptor-ref>
- <interceptor-ref name="workflow">
- <param
name="excludeMethods">input,back,cancel,browse</param>
- </interceptor-ref>
- </interceptor-stack>
-
- <!-- A complete stack with all the common interceptors in place.
- Generally, this stack should be the one you use, though it
- may do more than you need. Also, the ordering can be
- switched around (ex: if you wish to have your servlet-related
- objects applied before prepare() is called, you'd need to
move
- servletConfig interceptor up.
-
- This stack also excludes from the normal validation and
workflow
- the method names input, back, and cancel. These typically are
- associated with requests that should not be validated.
- -->
- <interceptor-stack name="defaultStack">
- <interceptor-ref name="exception"/>
- <interceptor-ref name="alias"/>
- <interceptor-ref name="servletConfig"/>
- <interceptor-ref name="i18n"/>
- <interceptor-ref name="prepare"/>
- <interceptor-ref name="chain"/>
- <interceptor-ref name="scopedModelDriven"/>
- <interceptor-ref name="modelDriven"/>
- <interceptor-ref name="fileUpload"/>
- <interceptor-ref name="checkbox"/>
- <interceptor-ref name="datetime"/>
- <interceptor-ref name="multiselect"/>
- <interceptor-ref name="staticParams"/>
- <interceptor-ref name="actionMappingParams"/>
- <interceptor-ref name="params"/>
- <interceptor-ref name="conversionError"/>
- <interceptor-ref name="validation">
- <param
name="excludeMethods">input,back,cancel,browse</param>
- </interceptor-ref>
- <interceptor-ref name="workflow">
- <param
name="excludeMethods">input,back,cancel,browse</param>
- </interceptor-ref>
- <interceptor-ref name="debugging"/>
- </interceptor-stack>
-
- <!-- The completeStack is here for backwards compatibility for
- applications that still refer to the defaultStack by the
- old name -->
- <interceptor-stack name="completeStack">
- <interceptor-ref name="defaultStack"/>
- </interceptor-stack>
-
- <!-- Sample execute and wait stack.
- Note: execAndWait should always be the *last* interceptor.
-->
- <interceptor-stack name="executeAndWaitStack">
- <interceptor-ref name="execAndWait">
- <param
name="excludeMethods">input,back,cancel</param>
- </interceptor-ref>
- <interceptor-ref name="defaultStack"/>
- <interceptor-ref name="execAndWait">
- <param
name="excludeMethods">input,back,cancel</param>
- </interceptor-ref>
- </interceptor-stack>
-
- </interceptors>
-
- <default-interceptor-ref name="defaultStack"/>
-
- <default-class-ref
class="com.opensymphony.xwork2.ActionSupport" />
-
-
<global-allowed-methods>execute,input,back,cancel,browse,save,delete,list,index</global-allowed-methods>
-
- </package>
-
-</struts>
-]]></script>
-</div></div>Since the <code>struts-default.xml</code> is included in the
application's configuration by default, all of the predefined interceptors and
stacks are available "out of the box".<h2
id="Interceptors-FrameworkInterceptors">Framework
Interceptors</h2><p>Interceptor classes are also defined using a key-value pair
specified in the Struts configuration file. The names specified below come
specified in <a shape="rect"
href="struts-defaultxml.html">struts-default.xml</a>. If you extend the
<code>struts-default</code> package, then you can use the names below.
Otherwise, they must be defined in your package with a name-class pair
specified in the <interceptors> tag.</p><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"><p>Interceptor</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="
1" class="confluenceTd"><p><a shape="rect" href="alias-interceptor.html">Alias
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>alias</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Converts similar parameters that may be named
differently between requests.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect"
href="chaining-interceptor.html">Chaining Interceptor</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>chain</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Makes the previous Action's properties
available to the current Action. Commonly used together with <result
type="chain"> (in the previous Action).</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><a shape="rect"
href="checkbox-interceptor.html">Checkbox Interceptor</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>checkbox</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Adds
automatic checkbox handling code that detect an unchecked checkbox and add it
as a parameter with a default (usually 'false') value. Uses a specially named
hidden field to detect unsubmitted checkboxes. The default unchecked value is
overridable for non-boolean value'd checkboxes.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect"
href="cookie-interceptor.html">Cookie Interceptor</a></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>cookie</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Inject cookie with a certain configurable name / value
into action. (Since 2.0.7.)</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect"
href="cookieprovider-interceptor.html">CookieProvider
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>cookieProvider</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Transfer cookies from action to response (Since
2.3.15.)</p></td></tr><tr><t
d colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect"
href="conversion-error-interceptor.html">Conversion Error
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>conversionError</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Adds conversion errors from the ActionContext to the
Action's field errors</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect"
href="create-session-interceptor.html">Create Session
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>createSession</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Create an HttpSession automatically, useful with
certain Interceptors that require a HttpSession to work properly (like the
TokenInterceptor)</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect"
href="debugginginterceptor.html">DebuggingInterceptor</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>debugging</p
></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Provides several
>different debugging screens to provide insight into the data behind the
>page.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a
>shape="rect" href="execute-and-wait-interceptor.html">Execute and Wait
>Interceptor</a></p></td><td colspan="1" rowspan="1"
>class="confluenceTd"><p>execAndWait</p></td><td colspan="1" rowspan="1"
>class="confluenceTd"><p>Executes the Action in the background and then sends
>the user off to an intermediate waiting page.</p></td></tr><tr><td
>colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect"
>href="exception-interceptor.html">Exception Interceptor</a></p></td><td
>colspan="1" rowspan="1" class="confluenceTd"><p>exception</p></td><td
>colspan="1" rowspan="1" class="confluenceTd"><p>Maps exceptions to a
>result.</p></td></tr><tr><td colspan="1" rowspan="1"
>class="confluenceTd"><p><a shape="rect"
>href="file-upload-interceptor.html">File Upload Interceptor</a></
p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>fileUpload</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>An Interceptor that adds easy access to file upload
support.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect" href="i18n-interceptor.html">I18n
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>i18n</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Remembers the locale selected for a user's
session.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect" href="logger-interceptor.html">Logger
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>logger</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Outputs the name of the Action.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect"
href="message-store-interceptor.html">Message Store Interceptor</a></p></td><td
colspan="1" rowspan="1" class="
confluenceTd"><p>store</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Store and retrieve action messages / errors / field
errors for action that implements ValidationAware interface into
session.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect"
href="model-driven-interceptor.html">Model Driven Interceptor</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>modelDriven</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>If the Action implements
ModelDriven, pushes the <code>getModel</code> Result onto the Value
Stack.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a
shape="rect" href="scoped-model-driven-interceptor.html">Scoped Model Driven
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>scopedModelDriven</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>If the Action implements ScopedModelDriven, the
interceptor retrieves and stores the model from a scop
e and sets it on the action calling
<code>setModel</code>.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect"
href="parameters-interceptor.html">Parameters Interceptor</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>params</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Sets the request parameters onto the
Action.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a
shape="rect" href="prepare-interceptor.html">Prepare
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>prepare</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>If the Action implements Preparable, calls its
<code>prepare</code> method.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect" href="scope-interceptor.html">Scope
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>scope</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Simple mech
anism for storing Action state in the session or application
scope.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a
shape="rect" href="servlet-config-interceptor.html">Servlet Config
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>servletConfig</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Provide access to Maps representing HttpServletRequest
and HttpServletResponse.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect"
href="static-parameters-interceptor.html">Static Parameters
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>staticParams</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Sets the <code>struts.xml</code> defined parameters
onto the action. These are the <param> tags that are direct children of
the <action> tag.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect" href="roles-interceptor.htm
l">Roles Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>roles</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Action will only be executed if the user has the
correct JAAS role.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect" href="timer-interceptor.html">Timer
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>timer</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Outputs how long the Action takes to execute (including
nested Interceptors and View)</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect" href="token-interceptor.html">Token
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>token</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Checks for valid token presence in Action, prevents
duplicate form submission.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect" hr
ef="token-session-interceptor.html">Token Session Interceptor</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>tokenSession</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Same as Token Interceptor, but
stores the submitted data in session when handed an invalid
token</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a
shape="rect" href="validation-interceptor.html">Validation
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>validation</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Performs validation using the validators defined in
<em>action</em>-validation.xml</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect"
href="default-workflow-interceptor.html">Default Workflow
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>workflow</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Calls the <code>validate</code> method in your Actio
n class. If Action errors are created then it returns the <code>INPUT</code>
view.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a
shape="rect" href="parameter-filter-interceptor.html">Parameter Filter
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>N/A</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Removes parameters from the list of those available to
Actions</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a
shape="rect" href="profiling-interceptor.html">Profiling
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>profiling</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Activate profiling through
parameter</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect"
href="multiselect-interceptor.html">Multiselect Interceptor</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>multiselect</p></td><td
colspan="1" rowspan="1"
class="confluenceTd"><p>Like the checkbox interceptor detects that no value
was selected for a field with multiple values (like a select) and adds an empty
parameter</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><a
shape="rect" href="noop-interceptor.html">NoOp Interceptor</a></td><td
colspan="1" rowspan="1" class="confluenceTd">noop</td><td colspan="1"
rowspan="1" class="confluenceTd">Does nothing, just passes invocation further,
used in empty stack</td></tr></tbody></table></div><div
class="confluence-information-macro confluence-information-macro-warning"><span
class="aui-icon aui-icon-small aui-iconfont-error
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>Since 2.0.7, Interceptors and
Results with hyphenated names were converted to camelCase. (The former
model-driven is now modelDriven.) The original hyphenated names are retained as
"aliases" until Struts 2.1.0. For clarity, the hyphenated versions are not
listed
here, but might be referenced in prior versions of the
documentation.</p></div></div><h3 id="Interceptors-MethodFiltering">Method
Filtering</h3><p>
-</p><p></p><p>
-MethodFilterInterceptor is an abstract <code>Interceptor</code> used as
-a base class for interceptors that will filter execution based on method
-names according to specified included/excluded method lists.</p>
-
-<p></p>
-
-<p>Settable parameters are as follows:</p>
-
-<p></p><ul><li>excludeMethods - method names to be excluded from interceptor
processing</li><li>includeMethods - method names to be included in interceptor
processing</li></ul>
-
-<p></p><p></p>
-
-<p><b>NOTE:</b> If method name are available in both includeMethods and
-excludeMethods, it will be considered as an included method:
-includeMethods takes precedence over excludeMethods.</p>
-
-<p></p>
-
-<p>Interceptors that extends this capability include:</p>
-
-<p></p><ul><li>TokenInterceptor</li><li>TokenSessionStoreInterceptor</li><li>DefaultWorkflowInterceptor</li><li>ValidationInterceptor</li></ul>
-<h3 id="Interceptors-InterceptorParameterOverriding">Interceptor Parameter
Overriding</h3><p>Interceptor's parameter could be overridden through the
following ways :</p><p><strong>Method 1</strong>:</p><div class="code panel
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><action name="myAction" class="myActionClass">
+</plain-text-body><p>Looking inside <code>struts-default.xml</code>, we can
see how it's done.</p><h3 id="Interceptors-TheDefaultConfiguration">The Default
Configuration</h3><p><plain-text-body>{snippet:id=all|lang=xml|url=struts2/core/src/main/resources/struts-default.xml}</plain-text-body>Since
the <code>struts-default.xml</code> is included in the application's
configuration by default, all of the predefined interceptors and stacks are
available "out of the box".</p><h2
id="Interceptors-FrameworkInterceptors">Framework
Interceptors</h2><p>Interceptor classes are also defined using a key-value pair
specified in the Struts configuration file. The names specified below come
specified in <a shape="rect"
href="struts-defaultxml.html">struts-default.xml</a>. If you extend the
<code>struts-default</code> package, then you can use the names below.
Otherwise, they must be defined in your package with a name-class pair
specified in the <interceptors> tag.</p><div class="table-wrap"><
table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"><p>Interceptor</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><a shape="rect"
href="alias-interceptor.html">Alias Interceptor</a></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>alias</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Converts similar parameters that may be named
differently between requests.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect"
href="chaining-interceptor.html">Chaining Interceptor</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>chain</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Makes the previous Action's properties
available to the current Action. Commonly used together with <result
type="chain"> (in the previous Ac
tion).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a
shape="rect" href="checkbox-interceptor.html">Checkbox
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>checkbox</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Adds automatic checkbox handling code that detect an
unchecked checkbox and add it as a parameter with a default (usually 'false')
value. Uses a specially named hidden field to detect unsubmitted checkboxes.
The default unchecked value is overridable for non-boolean value'd
checkboxes.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect" href="cookie-interceptor.html">Cookie
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>cookie</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Inject cookie with a certain configurable name / value
into action. (Since 2.0.7.)</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rec
t" href="cookieprovider-interceptor.html">CookieProvider
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>cookieProvider</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Transfer cookies from action to response (Since
2.3.15.)</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect"
href="conversion-error-interceptor.html">Conversion Error
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>conversionError</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Adds conversion errors from the ActionContext to the
Action's field errors</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect"
href="create-session-interceptor.html">Create Session
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>createSession</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Create an HttpSession automatically, useful with
certain Interceptors tha
t require a HttpSession to work properly (like the
TokenInterceptor)</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect"
href="debugginginterceptor.html">DebuggingInterceptor</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>debugging</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Provides several different
debugging screens to provide insight into the data behind the
page.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a
shape="rect" href="execute-and-wait-interceptor.html">Execute and Wait
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>execAndWait</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Executes the Action in the background and then sends
the user off to an intermediate waiting page.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><a shape="rect"
href="exception-interceptor.html">Exception Interceptor</a></p></td><td
colspan="1" r
owspan="1" class="confluenceTd"><p>exception</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Maps exceptions to a
result.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a
shape="rect" href="file-upload-interceptor.html">File Upload
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>fileUpload</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>An Interceptor that adds easy access to file upload
support.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect" href="i18n-interceptor.html">I18n
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>i18n</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Remembers the locale selected for a user's
session.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect" href="logger-interceptor.html">Logger
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>logger</p><
/td><td colspan="1" rowspan="1" class="confluenceTd"><p>Outputs the name of
the Action.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect"
href="message-store-interceptor.html">Message Store Interceptor</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>store</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Store and retrieve action messages / errors
/ field errors for action that implements ValidationAware interface into
session.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect"
href="model-driven-interceptor.html">Model Driven Interceptor</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>modelDriven</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>If the Action implements
ModelDriven, pushes the <code>getModel</code> Result onto the Value
Stack.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a
shape="rect" href="scoped-model-driven-intercepto
r.html">Scoped Model Driven Interceptor</a></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>scopedModelDriven</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>If the Action implements ScopedModelDriven,
the interceptor retrieves and stores the model from a scope and sets it on the
action calling <code>setModel</code>.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><a shape="rect"
href="parameters-interceptor.html">Parameters Interceptor</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>params</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Sets the request parameters onto the
Action.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a
shape="rect" href="prepare-interceptor.html">Prepare
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>prepare</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>If the Action implements Preparable, calls its
<code>prepare</code
> method.</p></td></tr><tr><td colspan="1" rowspan="1"
> class="confluenceTd"><p><a shape="rect" href="scope-interceptor.html">Scope
> Interceptor</a></p></td><td colspan="1" rowspan="1"
> class="confluenceTd"><p>scope</p></td><td colspan="1" rowspan="1"
> class="confluenceTd"><p>Simple mechanism for storing Action state in the
> session or application scope.</p></td></tr><tr><td colspan="1" rowspan="1"
> class="confluenceTd"><p><a shape="rect"
> href="servlet-config-interceptor.html">Servlet Config
> Interceptor</a></p></td><td colspan="1" rowspan="1"
> class="confluenceTd"><p>servletConfig</p></td><td colspan="1" rowspan="1"
> class="confluenceTd"><p>Provide access to Maps representing
> HttpServletRequest and HttpServletResponse.</p></td></tr><tr><td colspan="1"
> rowspan="1" class="confluenceTd"><p><a shape="rect"
> href="static-parameters-interceptor.html">Static Parameters
> Interceptor</a></p></td><td colspan="1" rowspan="1"
> class="confluenceTd"><p>staticParams</p></td><td colspan="1" rowspan="1"
> class=
"confluenceTd"><p>Sets the <code>struts.xml</code> defined parameters onto the
action. These are the <param> tags that are direct children of the
<action> tag.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect" href="roles-interceptor.html">Roles
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>roles</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Action will only be executed if the user has the
correct JAAS role.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect" href="timer-interceptor.html">Timer
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>timer</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Outputs how long the Action takes to execute (including
nested Interceptors and View)</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect" href="token-interceptor.html">Token
Interceptor</a></p></td>
<td colspan="1" rowspan="1" class="confluenceTd"><p>token</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Checks for valid token presence
in Action, prevents duplicate form submission.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><a shape="rect"
href="token-session-interceptor.html">Token Session Interceptor</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>tokenSession</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Same as Token Interceptor, but
stores the submitted data in session when handed an invalid
token</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a
shape="rect" href="validation-interceptor.html">Validation
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>validation</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Performs validation using the validators defined in
<em>action</em>-validation.xml</p></td></tr><tr><td colspan="1" rowspan="1"
class="conf
luenceTd"><p><a shape="rect" href="default-workflow-interceptor.html">Default
Workflow Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>workflow</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Calls the <code>validate</code> method in your Action
class. If Action errors are created then it returns the <code>INPUT</code>
view.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a
shape="rect" href="parameter-filter-interceptor.html">Parameter Filter
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>N/A</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Removes parameters from the list of those available to
Actions</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a
shape="rect" href="profiling-interceptor.html">Profiling
Interceptor</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>profiling</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Activate
profiling through parameter</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a shape="rect"
href="multiselect-interceptor.html">Multiselect Interceptor</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>multiselect</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Like the checkbox interceptor
detects that no value was selected for a field with multiple values (like a
select) and adds an empty parameter</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><a shape="rect"
href="noop-interceptor.html">NoOp Interceptor</a></td><td colspan="1"
rowspan="1" class="confluenceTd">noop</td><td colspan="1" rowspan="1"
class="confluenceTd">Does nothing, just passes invocation further, used in
empty stack</td></tr></tbody></table></div><rich-text-body><p>Since 2.0.7,
Interceptors and Results with hyphenated names were converted to camelCase.
(The former model-driven is now modelDriven.) The original hyphenated names are
retained as "alias
es" until Struts 2.1.0. For clarity, the hyphenated versions are not listed
here, but might be referenced in prior versions of the
documentation.</p></rich-text-body><h3 id="Interceptors-MethodFiltering">Method
Filtering</h3><p><plain-text-body>{snippet:id=javadoc|javadoc=true|url=com.opensymphony.xwork2.interceptor.MethodFilterInterceptor}</plain-text-body></p><h3
id="Interceptors-InterceptorParameterOverriding">Interceptor Parameter
Overriding</h3><p>Interceptor's parameter could be overridden through the
following ways :</p><p><strong>Method 1</strong>:</p><parameter
ac:name="">xml</parameter><plain-text-body><action name="myAction"
class="myActionClass">
<interceptor-ref name="exception"/>
<interceptor-ref name="alias"/>
<interceptor-ref name="params"/>
@@ -627,20 +174,14 @@ includeMethods takes precedence over excludeMethods.</p>
<param
name="excludeMethods">myWorkflowExcludeMethod</param>
</interceptor-ref>
</action>
-</pre>
-</div></div><p><strong>Method 2</strong>:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><action name="myAction" class="myActionClass">
+</plain-text-body><p><strong>Method 2</strong>:</p><parameter
ac:name="">xml</parameter><plain-text-body><action name="myAction"
class="myActionClass">
<interceptor-ref name="defaultStack">
<param
name="validation.excludeMethods">myValidationExcludeMethod</param>
<param
name="workflow.excludeMethods">myWorkflowExcludeMethod</param>
</interceptor-ref>
</action>
-</pre>
-</div></div><p>In the first method, the whole default stack is copied and the
parameter then changed accordingly.</p><p>In the second method, the
<code>interceptor-ref</code> refers to an existing interceptor-stack, namely
<code>defaultStack</code> in this example, and override the
<code>validator</code> and <code>workflow</code> interceptor
<code>excludeMethods</code> attribute. Note that in the <code>param</code> tag,
the name attribute contains a dot (.) the word before the dot(.) specifies the
interceptor name whose parameter is to be overridden and the word after the dot
(.) specifies the parameter itself. The syntax is as follows:</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"> <interceptor-name>.<parameter-name>
-</pre>
-</div></div><p>Note also that in this case the <code>interceptor-ref</code>
name attribute is used to indicate an interceptor stack which makes sense as if
it is referring to the interceptor itself it would be just using Method 1
describe above.</p><p><strong>Method 3</strong>:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><interceptors>
+</plain-text-body><p>In the first method, the whole default stack is copied
and the parameter then changed accordingly.</p><p>In the second method, the
<code>interceptor-ref</code> refers to an existing interceptor-stack, namely
<code>defaultStack</code> in this example, and override the
<code>validator</code> and <code>workflow</code> interceptor
<code>excludeMethods</code> attribute. Note that in the <code>param</code> tag,
the name attribute contains a dot (.) the word before the dot(.) specifies the
interceptor name whose parameter is to be overridden and the word after the dot
(.) specifies the parameter itself. The syntax is as
follows:</p><plain-text-body> <interceptor-name>.<parameter-name>
+</plain-text-body><p>Note also that in this case the
<code>interceptor-ref</code> name attribute is used to indicate an interceptor
stack which makes sense as if it is referring to the interceptor itself it
would be just using Method 1 describe above.</p><p><strong>Method
3</strong>:</p><parameter
ac:name="">xml</parameter><plain-text-body><interceptors>
<interceptor-stack name="parentStack">
<interceptor-ref name="defaultStack">
<param name="params.excludeParams">token</param>
@@ -649,32 +190,24 @@ includeMethods takes precedence over excludeMethods.</p>
</interceptors>
<default-interceptor-ref name="parentStack"/>
-</pre>
-</div></div><h3
id="Interceptors-InterceptorParameterOverridingInheritance">Interceptor
Parameter Overriding Inheritance</h3><p>Parameters override are not inherited
in interceptors, meaning that the last set of overridden parameters will be
used. For example, if a stack overrides the parameter "defaultBlock" for the
"postPrepareParameterFilter" interceptor as:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><interceptor-stack name="parentStack">
+</plain-text-body><h3
id="Interceptors-InterceptorParameterOverridingInheritance">Interceptor
Parameter Overriding Inheritance</h3><p>Parameters override are not inherited
in interceptors, meaning that the last set of overridden parameters will be
used. For example, if a stack overrides the parameter "defaultBlock" for the
"postPrepareParameterFilter" interceptor as:</p><parameter
ac:name="">xml</parameter><plain-text-body><interceptor-stack
name="parentStack">
<interceptor-ref name="postPrepareParameterFilter">
<param name="defaultBlock">true</param>
</interceptor-ref>
</interceptor-stack>
-</pre>
-</div></div><p>and an action overrides the "allowed" for
"postPrepareParameterFilter":</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><package name="child2" namespace="/child"
extends="parentPackage">
+</plain-text-body><p>and an action overrides the "allowed" for
"postPrepareParameterFilter":</p><parameter
ac:name="">xml</parameter><plain-text-body><package name="child2"
namespace="/child" extends="parentPackage">
<action name="list" class="SomeAction">
<interceptor-ref name="parentStack">
<param
name="postPrepareParameterFilter.allowed">myObject.name</param>
</interceptor-ref>
</action>
</package>
-</pre>
-</div></div><p>Then, only "allowed" will be overridden for the
"postPrepareParameterFilter" interceptor in that action, the other params will
be null.</p><h3 id="Interceptors-Lazyparameters">Lazy parameters</h3><div
class="confluence-information-macro confluence-information-macro-note"><span
class="aui-icon aui-icon-small aui-iconfont-warning
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>This functionality was added in
Struts 2.5.9</p></div></div><p>It is possible to define an interceptor with
parameters evaluated during action invocation. In such case the interceptor
must be marked with <code>WithLazyParams</code> interface. This must
be developer's decision as interceptor must be aware of having those parameters
set during invocation and not when the interceptor is created as it happens in
normal way.</p><p>Params are evaluated as any other expression starting with
from action as a top object.</p><div class="code panel pdl" s
tyle="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><action name="LazyFoo"
class="com.opensymphony.xwork2.SimpleAction">
+</plain-text-body><p>Then, only "allowed" will be overridden for the
"postPrepareParameterFilter" interceptor in that action, the other params will
be null.</p><h3 id="Interceptors-Lazyparameters">Lazy
parameters</h3><rich-text-body><p>This functionality was added in Struts
2.5.9</p></rich-text-body><p>It is possible to define an interceptor with
parameters evaluated during action invocation. In such case the interceptor
must be marked with <code>WithLazyParams</code> interface. This must
be developer's decision as interceptor must be aware of having those parameters
set during invocation and not when the interceptor is created as it happens in
normal way.</p><p>Params are evaluated as any other expression starting with
from action as a top object.</p><parameter
ac:name="">xml</parameter><plain-text-body><action name="LazyFoo"
class="com.opensymphony.xwork2.SimpleAction">
<result name="success">result.jsp</result>
<interceptor-ref name="lazy">
<param name="foo">${bar}</param>
</interceptor-ref>
-</action></pre>
-</div></div><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">public class MockLazyInterceptor extends
AbstractInterceptor implements WithLazyParams {
+</action></plain-text-body><parameter
ac:name="">java</parameter><plain-text-body>public class MockLazyInterceptor
extends AbstractInterceptor implements WithLazyParams {
private String foo = "";
@@ -686,17 +219,13 @@ includeMethods takes precedence over excludeMethods.</p>
....
return invocation.invoke();
}
-}</pre>
-</div></div><p>Please be aware that order of interceptors can matter when want
to access parameters passed via request as those parameters are set by <a
shape="rect" href="parameters-interceptor.html">Parameters
Interceptor</a>.</p><h3 id="Interceptors-OrderofInterceptorExecution">Order of
Interceptor Execution</h3><p>Interceptors provide an excellent means to wrap
before/after processing. The concept reduces code duplication (think
AOP).</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><interceptor-stack name="xaStack">
+}</plain-text-body><p>Please be aware that order of interceptors can matter
when want to access parameters passed via request as those parameters are set
by <a shape="rect" href="parameters-interceptor.html">Parameters
Interceptor</a>.</p><h3 id="Interceptors-OrderofInterceptorExecution">Order of
Interceptor Execution</h3><p>Interceptors provide an excellent means to wrap
before/after processing. The concept reduces code duplication (think
AOP).</p><parameter
ac:name="">xml</parameter><plain-text-body><interceptor-stack
name="xaStack">
<interceptor-ref name="thisWillRunFirstInterceptor"/>
<interceptor-ref name="thisWillRunNextInterceptor"/>
<interceptor-ref name="followedByThisInterceptor"/>
<interceptor-ref name="thisWillRunLastInterceptor"/>
</interceptor-stack>
-</pre>
-</div></div><p><img class="emoticon emoticon-warning"
src="https://cwiki.apache.org/confluence/s/en_GB/5997/6f42626d00e36f53fe51440403446ca61552e2a2.1/_/images/icons/emoticons/warning.png"
data-emoticon-name="warning" alt="(warning)"> Note that some Interceptors will
interrupt the stack/chain/flow ... so the order is very
important.</p><p>Interceptors implementing
<code>com.opensymphony.xwork2.interceptor.PreResultListener</code> will run
after the Action executes but before the Result executes.</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">thisWillRunFirstInterceptor
+</plain-text-body><p><img class="emoticon emoticon-warning"
src="https://cwiki.apache.org/confluence/s/en_GB/5997/6f42626d00e36f53fe51440403446ca61552e2a2.1/_/images/icons/emoticons/warning.png"
data-emoticon-name="warning" alt="(warning)"> Note that some Interceptors will
interrupt the stack/chain/flow ... so the order is very
important.</p><p>Interceptors implementing
<code>com.opensymphony.xwork2.interceptor.PreResultListener</code> will run
after the Action executes but before the Result
executes.</p><plain-text-body>thisWillRunFirstInterceptor
thisWillRunNextInterceptor
followedByThisInterceptor
thisWillRunLastInterceptor
@@ -708,8 +237,7 @@ includeMethods takes precedence over excludeMethods.</p>
followedByThisInterceptor
thisWillRunNextInterceptor
thisWillRunFirstInterceptor
-</pre>
-</div></div><h2 id="Interceptors-FAQ">FAQ</h2><ul><li><a shape="rect"
href="how-do-we-configure-an-interceptor-to-be-used-with-every-action.html">How
do we configure an Interceptor to be used with every Action</a>?</li><li><a
shape="rect" href="how-do-we-get-access-to-the-session.html">How do we get
access to the session</a>?</li><li><a shape="rect"
href="how-can-we-access-the-httpservletrequest.html">How can we access the
HttpServletRequest</a>?</li><li><a shape="rect"
href="how-can-we-access-the-httpservletresponse.html">How can we access the
HttpServletResponse</a>?</li><li><a shape="rect"
href="how-can-we-access-request-parameters-passed-into-an-action.html">How can
we access request parameters passed into an Action</a>?</li><li><a shape="rect"
href="how-do-we-access-static-parameters-from-an-action.html">How do we access
static parameters from an Action</a>?</li><li><a shape="rect"
href="can-we-access-an-actions-result.html">Can we access an Action's
Result</a>?</li><li><a shap
e="rect" href="how-do-i-obtain-security-details-jaas.html">How do I obtain
security details (JAAS)</a>?</li><li><a shape="rect"
href="why-isnt-our-prepare-interceptor-being-executed.html">Why isn't our
Prepare interceptor being executed</a>?</li><li><a shape="rect"
href="how-do-we-upload-files.html">How do we upload files</a>?</li></ul><h2
id="Interceptors-Next:">Next: <a shape="rect"
href="writing-interceptors.html">Writing Interceptors</a></h2></div>
+</plain-text-body><h2 id="Interceptors-FAQ">FAQ</h2><ul><li><a shape="rect"
href="how-do-we-configure-an-interceptor-to-be-used-with-every-action.html">How
do we configure an Interceptor to be used with every Action</a>?</li><li><a
shape="rect" href="how-do-we-get-access-to-the-session.html">How do we get
access to the session</a>?</li><li><a shape="rect"
href="how-can-we-access-the-httpservletrequest.html">How can we access the
HttpServletRequest</a>?</li><li><a shape="rect"
href="how-can-we-access-the-httpservletresponse.html">How can we access the
HttpServletResponse</a>?</li><li><a shape="rect"
href="how-can-we-access-request-parameters-passed-into-an-action.html">How can
we access request parameters passed into an Action</a>?</li><li><a shape="rect"
href="how-do-we-access-static-parameters-from-an-action.html">How do we access
static parameters from an Action</a>?</li><li><a shape="rect"
href="can-we-access-an-actions-result.html">Can we access an Action's
Result</a>?</li><li><
a shape="rect" href="how-do-i-obtain-security-details-jaas.html">How do I
obtain security details (JAAS)</a>?</li><li><a shape="rect"
href="why-isnt-our-prepare-interceptor-being-executed.html">Why isn't our
Prepare interceptor being executed</a>?</li><li><a shape="rect"
href="how-do-we-upload-files.html">How do we upload files</a>?</li></ul><h2
id="Interceptors-Next:">Next: <a shape="rect"
href="writing-interceptors.html">Writing Interceptors</a></h2></div>
</div>
<div class="tabletitle">