Modified: websites/production/struts/content/docs/struts-2-maven-archetypes.html
==============================================================================
--- websites/production/struts/content/docs/struts-2-maven-archetypes.html
(original)
+++ websites/production/struts/content/docs/struts-2-maven-archetypes.html Tue
Aug 25 07:57:34 2015
@@ -143,11 +143,11 @@ under the License.
<p><strong>Contents</strong></p>
<style type="text/css">/*<![CDATA[*/
-div.rbtoc1440486563546 {padding: 0px;}
-div.rbtoc1440486563546 ul {list-style: none;margin-left: 0px;padding-left:
1em;}
-div.rbtoc1440486563546 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1440489276784 {padding: 0px;}
+div.rbtoc1440489276784 ul {list-style: none;margin-left: 0px;padding-left:
1em;}
+div.rbtoc1440489276784 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style><div class="toc-macro rbtoc1440486563546">
+/*]]>*/</style><div class="toc-macro rbtoc1440489276784">
<ul class="toc-indentation"><li><span class="TOCOutline">1</span> <a
shape="rect"
href="#Struts2MavenArchetypes-Quickstart">Quickstart</a></li><li><span
class="TOCOutline">2</span> <a shape="rect"
href="#Struts2MavenArchetypes-AvailableArchetypes">Available Archetypes</a>
<ul class="toc-indentation"><li><span class="TOCOutline">2.1</span> <a
shape="rect"
href="#Struts2MavenArchetypes-TheBlankConventionArchetype(struts2-archetype-convention)">The
Blank Convention Archetype (struts2-archetype-convention)</a></li><li><span
class="TOCOutline">2.2</span> <a shape="rect"
href="#Struts2MavenArchetypes-TheBlankArchetype(struts2-archetype-blank)">The
Blank Archetype (struts2-archetype-blank)</a></li><li><span
class="TOCOutline">2.3</span> <a shape="rect"
href="#Struts2MavenArchetypes-TheStarterArchetype(struts2-archetype-starter)">The
Starter Archetype (struts2-archetype-starter)</a></li><li><span
class="TOCOutline">2.4</span> <a shape="rect"
href="#Struts2MavenArchetypes-TheAngularJSArchetype(struts2-archetype-angularjs)">The
AngularJS Archetype (struts2-archetype-angularjs)</a></li><li><span
class="TOCOutline">2.5</span> <a shape="rect"
href="#Struts2MavenArchetypes-ThePortletBlankArchetype(struts2-archetype-portlet)">The
Portlet Blank Archetype (struts2-ar
chetype-portlet)</a></li><li><span class="TOCOutline">2.6</span> <a
shape="rect"
href="#Struts2MavenArchetypes-ThePortletDatabaseArchetype(struts2-archetype-dbportlet)">The
Portlet Database Archetype (struts2-archetype-dbportlet)</a></li><li><span
class="TOCOutline">2.7</span> <a shape="rect"
href="#Struts2MavenArchetypes-ThePluginArchetype(struts2-archetype-plugin)">The
Plugin Archetype (struts2-archetype-plugin)</a></li></ul>
</li><li><span class="TOCOutline">3</span> <a shape="rect"
href="#Struts2MavenArchetypes-CreatinganApplicationUsingaMavenArchetype">Creating
an Application Using a Maven Archetype</a>
Modified:
websites/production/struts/content/docs/struts-2-spring-2-jpa-ajax.html
==============================================================================
--- websites/production/struts/content/docs/struts-2-spring-2-jpa-ajax.html
(original)
+++ websites/production/struts/content/docs/struts-2-spring-2-jpa-ajax.html Tue
Aug 25 07:57:34 2015
@@ -145,11 +145,11 @@ under the License.
<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>Following this tutorial verbatim
will require use of a Struts 2 deployment greater than 2.0.3</p></div></div>
<style type="text/css">/*<![CDATA[*/
-div.rbtoc1440486429793 {padding: 0px;}
-div.rbtoc1440486429793 ul {list-style: none;margin-left: 0px;}
-div.rbtoc1440486429793 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1440489150697 {padding: 0px;}
+div.rbtoc1440489150697 ul {list-style: none;margin-left: 0px;}
+div.rbtoc1440489150697 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style><div class="toc-macro rbtoc1440486429793">
+/*]]>*/</style><div class="toc-macro rbtoc1440489150697">
<ul class="toc-indentation"><li><a shape="rect"
href="#Struts2+Spring2+JPA+AJAX-Prerequisites">Prerequisites</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#Struts2+Spring2+JPA+AJAX-Tomcat">Tomcat</a></li><li><a shape="rect"
href="#Struts2+Spring2+JPA+AJAX-MySql">MySql</a></li></ul>
</li><li><a shape="rect" href="#Struts2+Spring2+JPA+AJAX-Getthecode">Get the
code</a>
Modified: websites/production/struts/content/docs/struts-next.html
==============================================================================
--- websites/production/struts/content/docs/struts-next.html (original)
+++ websites/production/struts/content/docs/struts-next.html Tue Aug 25
07:57:34 2015
@@ -125,12 +125,12 @@ under the License.
<div class="pagecontent">
<div class="wiki-content">
- <div id="ConfluenceContent"><h3
id="StrutsNext-/*<![CDATA[*/div.rbtoc1440486666365{padding:0px;}div.rbtoc1440486666365ul{list-style:disc;margin-left:0px;}div.rbtoc1440486666365li{margin-left:0px;padding-left:0px;}/*]]>*/#StrutsNext-Whatshouldbeimproved/changed#StrutsNext-Whatshouldbeimprove"><style
type="text/css">/*<![CDATA[*/
-div.rbtoc1440486666365 {padding: 0px;}
-div.rbtoc1440486666365 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1440486666365 li {margin-left: 0px;padding-left: 0px;}
+ <div id="ConfluenceContent"><h3
id="StrutsNext-/*<![CDATA[*/div.rbtoc1440489345560{padding:0px;}div.rbtoc1440489345560ul{list-style:disc;margin-left:0px;}div.rbtoc1440489345560li{margin-left:0px;padding-left:0px;}/*]]>*/#StrutsNext-Whatshouldbeimproved/changed#StrutsNext-Whatshouldbeimprove"><style
type="text/css">/*<![CDATA[*/
+div.rbtoc1440489345560 {padding: 0px;}
+div.rbtoc1440489345560 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1440489345560 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></h3><div class="toc-macro rbtoc1440486666365">
+/*]]>*/</style></h3><div class="toc-macro rbtoc1440489345560">
<ul class="toc-indentation"><li><a shape="rect"
href="#StrutsNext-"></a></li></ul>
<ul><li><a shape="rect" href="#StrutsNext-Whatshouldbeimproved/changed">What
should be improved / changed</a></li><li><a shape="rect"
href="#StrutsNext-DevelopmentplanofStruts3">Development plan of Struts 3</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#StrutsNext-M1(akaStruts2.5)">M1 (aka Struts 2.5)</a></li><li><a
shape="rect" href="#StrutsNext-M2(alphaStruts3)">M2 (alpha Struts
3)</a></li><li><a shape="rect" href="#StrutsNext-M3(alphaStruts3)">M3 (alpha
Struts 3)</a></li><li><a shape="rect" href="#StrutsNext-M4(beta1Struts3)">M4
(beta 1 Struts 3)</a></li></ul>
Modified: websites/production/struts/content/docs/tiles-2-plugin.html
==============================================================================
--- websites/production/struts/content/docs/tiles-2-plugin.html (original)
+++ websites/production/struts/content/docs/tiles-2-plugin.html Tue Aug 25
07:57:34 2015
@@ -138,63 +138,46 @@ under the License.
<div class="pagecontent">
<div class="wiki-content">
- <div id="ConfluenceContent"><div
class="confluence-information-macro
confluence-information-macro-information"><span class="aui-icon aui-icon-small
aui-iconfont-info confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>Tiles is a templating framework
designed to easily allow the creation of web application pages with a
consistent look and feel. It can be used for both page decorating and
componentization.</p></div></div>
-<p>The Tiles plugin allows actions to return Tiles pages.</p>
-
-<h2 id="Tiles2Plugin-Features">Features</h2>
-
-<ul><li>Supports Tiles in Freemarker, JSP, and Velocity</li></ul>
-
-
-<h2 id="Tiles2Plugin-Usage">Usage</h2>
-
-<p>The following steps must be taken in order to enable tiles support within
your Struts2 application:</p>
-<ol><li>Include the struts-tiles-plugin as a dependency in your web
application. If you are using maven2, the dependency configuration will be
similar to:
-<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;">
-<dependency>
+ <div id="ConfluenceContent"><div
class="confluence-information-macro
confluence-information-macro-information"><span class="aui-icon aui-icon-small
aui-iconfont-info confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>Tiles is a templating framework
designed to easily allow the creation of web application pages with a
consistent look and feel. It can be used for both page decorating and
componentization.</p></div></div><p>The Tiles pluginallows actions to return
Tiles pages.</p><h2 id="Tiles2Plugin-Features">Features</h2><ul><li>Supports
Tiles in Freemarker, JSP, and Velocity</li></ul><h2
id="Tiles2Plugin-Usage">Usage</h2><p>The following steps must be taken in order
to enable tiles support within your Struts2 application:</p><ol><li><p>Include
the struts-tiles-plugin as a dependency in your web application. If you are
using maven2, the dependency configuration will be similar to:</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;"><dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-tiles-plugin</artifactId>
<version>${version.tiles}</version>
<scope>compile</scope>
</dependency>
</pre>
-</div></div></li><li>Register the tiles listener. This listener will
typically either be the standard tiles listener
(org.apache.tiles.listener.TilesListener) or the Struts2 replacement
(org.apache.struts2.tiles.TilesListener). The latter provides tighter
integration with Struts features such as freemarker integration.
-<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;">
-<listener>
+</div></div></li><li><p>Register the tiles listener. This listener will
typically either be the standard tiles listener
(org.apache.tiles.listener.TilesListener) or the Struts2 replacement
(org.apache.struts2.tiles.TilesListener). The latter provides tighter
integration with Struts features such as freemarker integration.</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;"><listener>
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>
</pre>
-</div></div></li><li>All package definitions which require tiles support must
either extend the tiles-default package or must register the <a shape="rect"
class="createlink"
href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=WW&title=Tiles+Result&linkCreation=true&fromPageId=27401">Tiles
Result</a> type definition.
-<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;">
-<result-types>
+</div></div></li><li><p>All package definitions which require tiles support
must either extend the tiles-default package or must register the <a
shape="rect" class="createlink"
href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=WW&title=Tiles+Result&linkCreation=true&fromPageId=27401">Tiles
Result</a> type definition.</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;"><result-types>
<result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult"/>
</result-types>
</pre>
-</div></div></li><li>Configure your actions to utilize a tiles definition:
-<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="sample" class="org.apache.struts2.tiles.example.SampleAction"
>
+</div></div></li><li><p>Configure your actions to utilize a tiles
definition:</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="sample"
class="org.apache.struts2.tiles.example.SampleAction" >
<result name="success" type="tiles">tilesWorks</result>
</action>
</pre>
-</div></div></li></ol>
-
-
-<h2 id="Tiles2Plugin-Example">Example</h2>
-
-<p>This example shows a Tiles layout page using Struts tags:</p>
-<div class="error"><span class="error">Error formatting macro: snippet:
java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
-
-<h2 id="Tiles2Plugin-Settings">Settings</h2>
-
-<p>This plugin does inherits settings from <a shape="rect"
class="external-link"
href="http://tiles.apache.org/config-reference.html">Tiles
configuration</a>.</p>
-
-<h2 id="Tiles2Plugin-Installation">Installation</h2>
-
-<p>This plugin can be installed by copying the plugin jar into your
application's <code>/WEB-INF/lib</code> directory. No other files need to be
copied or created.</p></div>
+</div></div></li></ol><h2 id="Tiles2Plugin-Example">Example</h2><p>This
example shows a Tiles layout page using Struts tags:</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[
+<%@ taglib uri="http://tiles.apache.org/tags-tiles"
prefix="tiles" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<%-- Show usage; Used in Header --%>
+<tiles:importAttribute name="title" scope="request"/>
+<html>
+ <head><title>Struts2 Showcase - <tiles:getAsString
name="title"/></title></head>
+<body>
+ <tiles:insertAttribute name="header"/>
+ <tiles:insertAttribute name="body"/>
+ <p>Notice that this is a layout made in JSP</p>
+</body>
+</html>
+]]></script>
+</div></div><h2 id="Tiles2Plugin-Settings">Settings</h2><p>This plugin does
inherits settings from <a shape="rect" class="external-link"
href="http://tiles.apache.org/config-reference.html">Tiles
configuration</a>.</p><h2
id="Tiles2Plugin-Installation">Installation</h2><p>This plugin can be installed
by copying the plugin jar into your application's <code>/WEB-INF/lib</code>
directory. No other files need to be copied or created.</p></div>
</div>
<div class="tabletitle">
Modified: websites/production/struts/content/docs/type-conversion.html
==============================================================================
--- websites/production/struts/content/docs/type-conversion.html (original)
+++ websites/production/struts/content/docs/type-conversion.html Tue Aug 25
07:57:34 2015
@@ -141,11 +141,11 @@ under the License.
<div id="ConfluenceContent"><p>Routine type conversion in the
framework is transparent. Generally, all you need to do is ensure that HTML
inputs have names that can be used in <a shape="rect" href="ognl.html">OGNL</a>
expressions. (HTML inputs are form elements and other GET/POST parameters.)</p>
<style type="text/css">/*<![CDATA[*/
-div.rbtoc1440486120543 {padding: 0px;}
-div.rbtoc1440486120543 ul {list-style: none;margin-left: 0px;}
-div.rbtoc1440486120543 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1440488825603 {padding: 0px;}
+div.rbtoc1440488825603 ul {list-style: none;margin-left: 0px;}
+div.rbtoc1440488825603 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style><div class="toc-macro rbtoc1440486120543">
+/*]]>*/</style><div class="toc-macro rbtoc1440488825603">
<ul class="toc-indentation"><li><span class="TOCOutline">1</span> <a
shape="rect" href="#TypeConversion-BuiltinTypeConversionSupport">Built in Type
Conversion Support</a></li><li><span class="TOCOutline">2</span> <a
shape="rect" href="#TypeConversion-RelationshiptoParameterNames">Relationship
to Parameter Names</a></li><li><span class="TOCOutline">3</span> <a
shape="rect" href="#TypeConversion-CreatingaTypeConverter">Creating a Type
Converter</a></li><li><span class="TOCOutline">4</span> <a shape="rect"
href="#TypeConversion-ApplyingaTypeConvertertoanAction">Applying a Type
Converter to an Action</a></li><li><span class="TOCOutline">5</span> <a
shape="rect"
href="#TypeConversion-ApplyingaTypeConvertertoabeanormodel">Applying a Type
Converter to a bean or model</a></li><li><span class="TOCOutline">6</span> <a
shape="rect"
href="#TypeConversion-ApplyingaTypeConverterforanapplication">Applying a Type
Converter for an application</a></li><li><span class="TOCOutline">7</span> <a
shape="r
ect" href="#TypeConversion-ASimpleExample">A Simple Example</a></li><li><span
class="TOCOutline">8</span> <a shape="rect"
href="#TypeConversion-AdvancedTypeConversion">Advanced Type Conversion</a>
<ul class="toc-indentation"><li><span class="TOCOutline">8.1</span> <a
shape="rect" href="#TypeConversion-NullPropertyHandling">Null Property
Handling</a></li><li><span class="TOCOutline">8.2</span> <a shape="rect"
href="#TypeConversion-CollectionandMapSupport">Collection and Map Support</a>
<ul class="toc-indentation"><li><span class="TOCOutline">8.2.1</span> <a
shape="rect"
href="#TypeConversion-Indexingacollectionbyapropertyofthatcollection">Indexing
a collection by a property of that collection</a></li></ul>
Modified: websites/production/struts/content/docs/using-field-validators.html
==============================================================================
--- websites/production/struts/content/docs/using-field-validators.html
(original)
+++ websites/production/struts/content/docs/using-field-validators.html Tue Aug
25 07:57:34 2015
@@ -138,17 +138,40 @@ under the License.
<div class="pagecontent">
<div class="wiki-content">
- <div id="ConfluenceContent"><h2
id="UsingFieldValidators-Description">Description</h2>
-<p>The followings show a simple example using Struts' Field Validators</p>
-
-<h3 id="UsingFieldValidators-Step1">Step 1</h3>
-<p>Create the jsp page</p>
-<div class="error"><span class="error">Error formatting macro: snippet:
java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+ <div id="ConfluenceContent"><h2
id="UsingFieldValidators-Description">Description</h2><p>The followings show a
simple example using Struts' Field Validators</p><h3
id="UsingFieldValidators-Step1">Step 1</h3><p>Create the jsp page</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[
+<h3>All Field Errors Will Appear Here</h3>
+<s:fielderror/>
+<hr/>
+
+<h3>Field Error due to 'Required String Validator Field' Will
Appear Here</h3>
+<s:fielderror>
+ <s:param
value="%{'requiredStringValidatorField'}"/>
+</s:fielderror>
+<hr/>
+
+<h3>Field Error due to 'String Length Validator Field' Will
Appear Here</h3>
+<s:fielderror>
+ <s:param>stringLengthValidatorField</s:param>
+</s:fielderror>
+<hr/>
+
+<s:form action="submitFieldValidatorsExamples"
namespace="/validation" method="POST"
theme="xhtml">
+ <s:textfield label="Required Validator Field"
name="requiredValidatorField"/>
+ <s:textfield label="Required String Validator Field"
name="requiredStringValidatorField"/>
+ <s:textfield label="Integer Validator Field"
name="integerValidatorField"/>
+ <s:textfield label="Date Validator Field"
name="dateValidatorField"/>
+ <s:textfield label="Email Validator Field"
name="emailValidatorField"/>
+ <s:textfield label="URL Validator Field"
name="urlValidatorField"/>
+ <s:textfield label="String Length Validator Field"
name="stringLengthValidatorField"/>
+ <s:textfield label="Regex Validator Field"
name="regexValidatorField"/>
+ <s:textfield label="Field Expression Validator Field"
name="fieldExpressionValidatorField"/>
+ <s:submit label="Submit" cssClass="btn
btn-primary"/>
+</s:form>
-<h3 id="UsingFieldValidators-Step2">Step 2</h3>
-<p>Create the action class</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+]]></script>
+</div></div><h3 id="UsingFieldValidators-Step2">Step 2</h3><p>Create the
action class</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
<script class="brush: java; gutter: false; theme: Default"
type="syntaxhighlighter"><![CDATA[
*/
public class FieldValidatorsExampleAction extends
AbstractValidationActionSupport {
@@ -242,12 +265,7 @@ public class FieldValidatorsExampleActio
/**
]]></script>
-</div></div>
-
-
-<h3 id="UsingFieldValidators-Step3">Step 3</h3>
-<p>Create the validator.xml.</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+</div></div><h3 id="UsingFieldValidators-Step3">Step 3</h3><p>Create the
validator.xml.</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[
<validators>
@@ -309,10 +327,7 @@ public class FieldValidatorsExampleActio
</validators>
]]></script>
-</div></div>
-
-
-</div>
+</div></div></div>
</div>
Modified:
websites/production/struts/content/docs/using-freemarker-templates.html
==============================================================================
--- websites/production/struts/content/docs/using-freemarker-templates.html
(original)
+++ websites/production/struts/content/docs/using-freemarker-templates.html Tue
Aug 25 07:57:34 2015
@@ -141,11 +141,11 @@ under the License.
<div id="ConfluenceContent"><p><a shape="rect"
class="external-link" href="http://freemarker.sourceforge.net/"
rel="nofollow">FreeMarker</a> is a Java-based template engine that is a great
alternative to <a shape="rect" href="jsp.html">JSP</a>. FreeMarker is ideal for
situations where your action results can possibly be loaded from outside a
Servlet container. For example, if you wished to support plugins in your
application, you might wish to use FreeMarker so that the plugins could provide
the entire action class and view in a single jar that is loaded from the
classloader.</p>
<style type="text/css">/*<![CDATA[*/
-div.rbtoc1440486450795 {padding: 0px;}
-div.rbtoc1440486450795 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1440486450795 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1440489164885 {padding: 0px;}
+div.rbtoc1440489164885 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1440489164885 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style><div class="toc-macro rbtoc1440486450795">
+/*]]>*/</style><div class="toc-macro rbtoc1440489164885">
<ul class="toc-indentation"><li><a shape="rect"
href="#UsingFreemarkerTemplates-Configureyouractiontousethe"freemarker"resulttype">Configure
your action to use the "freemarker" result type</a></li><li><a shape="rect"
href="#UsingFreemarkerTemplates-Usingproperties">Using
properties</a></li><li><a shape="rect"
href="#UsingFreemarkerTemplates-Servlet/JSPScopedObjects">Servlet / JSP Scoped
Objects</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#UsingFreemarkerTemplates-ApplicationScopeAttribute">Application Scope
Attribute</a></li><li><a shape="rect"
href="#UsingFreemarkerTemplates-SessionScopeAttribute">Session Scope
Attribute</a></li><li><a shape="rect"
href="#UsingFreemarkerTemplates-RequestScopeAttribute">Request Scope
Attribute</a></li><li><a shape="rect"
href="#UsingFreemarkerTemplates-RequestParameter">Request
Parameter</a></li><li><a shape="rect"
href="#UsingFreemarkerTemplates-Contextparameter">Context
parameter</a></li></ul>
</li><li><a shape="rect"
href="#UsingFreemarkerTemplates-TemplateLoading">Template
Loading</a></li><li><a shape="rect"
href="#UsingFreemarkerTemplates-VariableResolution">Variable
Resolution</a></li><li><a shape="rect"
href="#UsingFreemarkerTemplates-FreeMarkerconfiguration">FreeMarker
configuration</a></li><li><a shape="rect"
href="#UsingFreemarkerTemplates-Tags">Tags</a>
Modified:
websites/production/struts/content/docs/using-non-field-validators.html
==============================================================================
--- websites/production/struts/content/docs/using-non-field-validators.html
(original)
+++ websites/production/struts/content/docs/using-non-field-validators.html Tue
Aug 25 07:57:34 2015
@@ -138,17 +138,20 @@ under the License.
<div class="pagecontent">
<div class="wiki-content">
- <div id="ConfluenceContent"><h2
id="UsingNonFieldValidators-Description">Description</h2>
-<p>The followings show a simple example using Webwork's Non Field
Validators</p>
+ <div id="ConfluenceContent"><h2
id="UsingNonFieldValidators-Description">Description</h2><p>The followings show
a simple example using Webwork's Non Field Validators</p><h3
id="UsingNonFieldValidators-Step1">Step 1</h3><p>Create the jsp page</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[
+<s:actionerror/>
-<h3 id="UsingNonFieldValidators-Step1">Step 1</h3>
-<p>Create the jsp page</p>
-<div class="error"><span class="error">Error formatting macro: snippet:
java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<s:form method="POST"
action="submitNonFieldValidatorsExamples"
namespace="/validation">
+ <s:textfield name="someText" label="Some
Text"/>
+ <s:textfield name="someTextRetype" label="Retype Some
Text"/>
+ <s:textfield name="someTextRetypeAgain" label="Retype
Some Text Again"/>
+ <s:submit label="Submit" cssClass="btn
btn-primary"/>
+</s:form>
-<h3 id="UsingNonFieldValidators-Step2">Step 2</h3>
-<p>Create the action class</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+]]></script>
+</div></div><h3 id="UsingNonFieldValidators-Step2">Step 2</h3><p>Create the
action class</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
<script class="brush: java; gutter: false; theme: Default"
type="syntaxhighlighter"><![CDATA[
public class NonFieldValidatorsExampleAction extends
AbstractValidationActionSupport {
@@ -186,12 +189,7 @@ public class NonFieldValidatorsExampleAc
]]></script>
-</div></div>
-
-
-<h3 id="UsingNonFieldValidators-Step3">Step 3</h3>
-<p>Create the validator.xml.</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+</div></div><h3 id="UsingNonFieldValidators-Step3">Step 3</h3><p>Create the
validator.xml.</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[
<validators>
@@ -202,8 +200,7 @@ public class NonFieldValidatorsExampleAc
</validators>
]]></script>
-</div></div>
-</div>
+</div></div></div>
</div>
Modified:
websites/production/struts/content/docs/using-visitor-field-validator.html
==============================================================================
--- websites/production/struts/content/docs/using-visitor-field-validator.html
(original)
+++ websites/production/struts/content/docs/using-visitor-field-validator.html
Tue Aug 25 07:57:34 2015
@@ -138,17 +138,20 @@ under the License.
<div class="pagecontent">
<div class="wiki-content">
- <div id="ConfluenceContent"><h2
id="UsingVisitorFieldValidator-Description">Description</h2>
-<p>The followings show a simple example using Webwork's Field Validators</p>
+ <div id="ConfluenceContent"><h2
id="UsingVisitorFieldValidator-Description">Description</h2><p>The followings
show a simple example using Webwork's Field Validators</p><h3
id="UsingVisitorFieldValidator-Step1">Step 1</h3><p>Create the jsp
page.</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[
-<h3 id="UsingVisitorFieldValidator-Step1">Step 1</h3>
-<p>Create the jsp page.</p>
-<div class="error"><span class="error">Error formatting macro: snippet:
java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<s:fielderror cssClass="alert alert-error"/>
+<s:form method="POST"
action="submitVisitorValidatorsExamples"
namespace="/validation">
+ <s:textfield name="user.name" label="User
Name"/>
+ <s:textfield name="user.age" label="User
Age"/>
+ <s:textfield name="user.birthday"
label="Birthday"/>
+ <s:submit label="Submit" cssClass="btn
btn-primary"/>
+</s:form>
-<h3 id="UsingVisitorFieldValidator-Step2">Step 2</h3>
-<p>Create the action class.</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+]]></script>
+</div></div><h3 id="UsingVisitorFieldValidator-Step2">Step 2</h3><p>Create the
action class.</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
<script class="brush: java; gutter: false; theme: Default"
type="syntaxhighlighter"><![CDATA[
public class VisitorValidatorsExampleAction extends
AbstractValidationActionSupport {
@@ -168,12 +171,7 @@ public class VisitorValidatorsExampleAct
]]></script>
-</div></div>
-
-
-<h3 id="UsingVisitorFieldValidator-Step3">Step 3</h3>
-<p>Create the validator.xml.</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+</div></div><h3 id="UsingVisitorFieldValidator-Step3">Step 3</h3><p>Create the
validator.xml.</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[
<validators>
@@ -188,8 +186,7 @@ public class VisitorValidatorsExampleAct
]]></script>
-</div></div>
-</div>
+</div></div></div>
</div>
Modified: websites/production/struts/content/docs/validation.html
==============================================================================
--- websites/production/struts/content/docs/validation.html (original)
+++ websites/production/struts/content/docs/validation.html Tue Aug 25 07:57:34
2015
@@ -139,18 +139,44 @@ under the License.
<div class="pagecontent">
<div class="wiki-content">
<div id="ConfluenceContent"><p>Struts 2 validation is configured
via XML or annotations. Manual validation in the action is also possible, and
may be combined with XML and annotation-driven validation.</p><p>Validation
also depends on both the <code>validation</code> and <code>workflow</code>
interceptors (both are included in the default interceptor stack). The
<code>validation</code> interceptor does the validation itself and creates a
list of field-specific errors. The <code>workflow</code> interceptor checks for
the presence of validation errors: if any are found, it returns the "input"
result (by default), taking the user back to the form which contained the
validation errors.</p><p>If we're using the default settings <em>and</em> our
action doesn't have an "input" result defined <em>and</em> there are validation
(or, incidentally, type conversion) errors, we'll get an error message back
telling us there's no "input" result defined for the action.</p><p><strong>CONT
ENTS</strong></p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1440486361978 {padding: 0px;}
-div.rbtoc1440486361978 ul {list-style: none;margin-left: 0px;}
-div.rbtoc1440486361978 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1440489032825 {padding: 0px;}
+div.rbtoc1440489032825 ul {list-style: none;margin-left: 0px;}
+div.rbtoc1440489032825 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1440486361978">
+/*]]>*/</style></p><div class="toc-macro rbtoc1440489032825">
<ul class="toc-indentation"><li><span class="TOCOutline">1</span> <a
shape="rect" href="#Validation-UsingAnnotations">Using
Annotations</a></li><li><span class="TOCOutline">2</span> <a shape="rect"
href="#Validation-BeanValidation">Bean Validation</a></li><li><span
class="TOCOutline">3</span> <a shape="rect"
href="#Validation-Examples">Examples</a></li><li><span
class="TOCOutline">4</span> <a shape="rect"
href="#Validation-BundledValidators">Bundled Validators</a></li><li><span
class="TOCOutline">5</span> <a shape="rect"
href="#Validation-RegisteringValidators">Registering
Validators</a></li><li><span class="TOCOutline">6</span> <a shape="rect"
href="#Validation-TurningonValidation">Turning on Validation</a></li><li><span
class="TOCOutline">7</span> <a shape="rect"
href="#Validation-ValidatorScopes">Validator Scopes</a>
<ul class="toc-indentation"><li><span class="TOCOutline">7.1</span> <a
shape="rect" href="#Validation-Notes">Notes</a></li></ul>
</li><li><span class="TOCOutline">8</span> <a shape="rect"
href="#Validation-DefiningValidationRules">Defining Validation
Rules</a></li><li><span class="TOCOutline">9</span> <a shape="rect"
href="#Validation-LocalizingandParameterizingMessages">Localizing and
Parameterizing Messages</a></li><li><span class="TOCOutline">10</span> <a
shape="rect" href="#Validation-ValidatorFlavor">Validator
Flavor</a></li><li><span class="TOCOutline">11</span> <a shape="rect"
href="#Validation-Non-FieldValidatorVsField-Validatorvalidatortypes">Non-Field
Validator Vs Field-Validator</a></li><li><span class="TOCOutline">12</span> <a
shape="rect" href="#Validation-Short-CircuitingValidator">Short-Circuiting
Validator</a></li><li><span class="TOCOutline">13</span> <a shape="rect"
href="#Validation-HowValidatorsofanActionareFound">How Validators of an Action
are Found</a></li><li><span class="TOCOutline">14</span> <a shape="rect"
href="#Validation-Writingcustomvalidators">Writing custom validators</a></li>
<li><span class="TOCOutline">15</span> <a shape="rect"
href="#Validation-Resources">Resources</a></li><li><span
class="TOCOutline">16</span> <a shape="rect" href="#Validation-Next:">Next:
Localization</a></li></ul>
-</div><h2 id="Validation-UsingAnnotations">Using Annotations</h2><p><a
shape="rect" href="validation-annotation.html">Annotations</a> can be used as
an alternative to XML for validation.</p><p> </p><h2
id="Validation-BeanValidation">Bean Validation</h2><p>With struts 2.5 comes the
Bean Validation Plugin. That is an alternative to the classic struts validation
described here. See the <a shape="rect"
href="bean-validation-plugin.html">Plugin Page</a> for details.</p><h2
id="Validation-Examples">Examples</h2><p>In all examples given here, the
validation message displayed is given in plain English - to internationalize
the message, put the string in a properties file and use a property key
instead, specified by the 'key' attribute. It will be looked up by the
framework (see <a shape="rect"
href="localization.html">Localization</a>).</p><ol><li><a shape="rect"
href="basic-validation.html">Basic Validation</a></li><li><a shape="rect"
href="client-validation.html">Client-side Validati
on</a></li><li><a shape="rect" href="ajax-validation.html">AJAX
Validation</a></li><li><a shape="rect" href="using-field-validators.html">Using
Field Validators</a></li><li><a shape="rect"
href="using-non-field-validators.html">Using Non Field
Validators</a></li><li><a shape="rect"
href="using-visitor-field-validator.html">Using Visitor Field
Validator</a></li><li><a shape="rect"
href="how-do-we-repopulate-controls-when-validation-fails.html">How do we
repopulate controls when validation fails</a> (FAQ entry)</li></ol><h2
id="Validation-BundledValidators">Bundled Validators</h2><div
class="confluence-information-macro confluence-information-macro-note"><p
class="title">Note</p><span class="aui-icon aui-icon-small aui-iconfont-warning
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>When using a Field Validator,
Field Validator Syntax is <strong>ALWAYS</strong> preferable than using the
Plain Validator Syntax as it facilitates grouping of fi
eld-validators according to fields. This is very handy especially if a field
needs to have many <code>field-validators</code> which is almost always the
case.</p></div></div><ol><li><a shape="rect"
href="conversion-validator.html">conversion validator</a></li><li><a
shape="rect" href="date-validator.html">date validator</a></li><li><a
shape="rect" href="double-validator.html">double validator</a></li><li><a
shape="rect" href="email-validator.html">email validator</a></li><li><a
shape="rect" href="expression-validator.html">expression
validator</a></li><li><a shape="rect"
href="fieldexpression-validator.html">fieldexpression validator</a></li><li><a
shape="rect" href="int-validator.html">int validator</a></li><li><a
shape="rect" href="regex-validator.html">regex validator</a></li><li><a
shape="rect" href="required-validator.html">required validator</a></li><li><a
shape="rect" href="requiredstring-validator.html">requiredstring
validator</a></li><li><a shape="rect" href="short-validat
or.html">short validator</a></li><li><a shape="rect"
href="stringlength-validator.html">stringlength validator</a></li><li><a
shape="rect" href="url-validator.html">url validator</a></li><li><a
shape="rect" href="visitor-validator.html">visitor validator</a></li><li><a
shape="rect" href="conditionalvisitor-validator.html">conditionalvisitor
validator</a></li></ol><h2 id="Validation-RegisteringValidators">Registering
Validators</h2><p>Validation rules are handled by validators, which must be
registered with
+</div><h2 id="Validation-UsingAnnotations">Using Annotations</h2><p><a
shape="rect" href="validation-annotation.html">Annotations</a> can be used as
an alternative to XML for validation.</p><p> </p><h2
id="Validation-BeanValidation">Bean Validation</h2><p>With struts 2.5 comes the
Bean Validation Plugin. That is an alternative to the classic struts validation
described here. See the <a shape="rect"
href="bean-validation-plugin.html">Plugin Page</a> for details.</p><h2
id="Validation-Examples">Examples</h2><p>In all examples given here, the
validation message displayed is given in plain English - to internationalize
the message, put the string in a properties file and use a property key
instead, specified by the 'key' attribute. It will be looked up by the
framework (see <a shape="rect"
href="localization.html">Localization</a>).</p><ol><li><a shape="rect"
href="basic-validation.html">Basic Validation</a></li><li><a shape="rect"
href="client-validation.html">Client-side Validati
on</a></li><li><a shape="rect" href="ajax-validation.html">AJAX
Validation</a></li><li><a shape="rect" href="using-field-validators.html">Using
Field Validators</a></li><li><a shape="rect"
href="using-non-field-validators.html">Using Non Field
Validators</a></li><li><a shape="rect"
href="using-visitor-field-validator.html">Using Visitor Field
Validator</a></li><li><a shape="rect"
href="how-do-we-repopulate-controls-when-validation-fails.html">How do we
repopulate controls when validation fails</a> (FAQ entry)</li></ol><h2
id="Validation-BundledValidators">Bundled Validators</h2><div
class="confluence-information-macro confluence-information-macro-note"><p
class="title">Note</p><span class="aui-icon aui-icon-small aui-iconfont-warning
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>When using a Field Validator,
Field Validator Syntax is <strong>ALWAYS</strong> preferable than using the
Plain Validator Syntax as it facilitates grouping of fi
eld-validators according to fields. This is very handy especially if a field
needs to have many <code>field-validators</code> which is almost always the
case.</p></div></div><ol><li><a shape="rect"
href="conversion-validator.html">conversion validator</a></li><li><a
shape="rect" href="date-validator.html">date validator</a></li><li><a
shape="rect" href="double-validator.html">double validator</a></li><li><a
shape="rect" href="email-validator.html">email validator</a></li><li><a
shape="rect" href="expression-validator.html">expression
validator</a></li><li><a shape="rect"
href="fieldexpression-validator.html">fieldexpression validator</a></li><li><a
shape="rect" href="int-validator.html">int validator</a></li><li><a
shape="rect" href="regex-validator.html">regex validator</a></li><li><a
shape="rect" href="required-validator.html">required validator</a></li><li><a
shape="rect" href="requiredstring-validator.html">requiredstring
validator</a></li><li><a shape="rect" href="short-validat
or.html">short validator</a></li><li><a shape="rect"
href="stringlength-validator.html">stringlength validator</a></li><li><a
shape="rect" href="url-validator.html">url validator</a></li><li><a
shape="rect" href="visitor-validator.html">visitor validator</a></li><li><a
shape="rect" href="conditionalvisitor-validator.html">conditionalvisitor
validator</a></li></ol><h2 id="Validation-RegisteringValidators">Registering
Validators</h2><p></p><p>Validation rules are handled by validators, which must
be registered with
the ValidatorFactory (using the registerValidator method). The simplest way to
do so is to add a file name
validators.xml in the root of the classpath (/WEB-INF/classes) that declares
-all the validators you intend to use.</p><p>The following list shows the
default validators included in the framework and is an example of the syntax
used to declare our own validators.</p><div class="error"><span
class="error">Error formatting macro: snippet:
java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div><div
class="confluence-information-macro confluence-information-macro-note"><p
class="title">Struts 2.1 and Prior</p><span class="aui-icon aui-icon-small
aui-iconfont-warning confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>The <code>validators.xml</code>
used to reference a DTD hosted by Opensymphony, the original location of the
XWork project. Since the the move to Apache Struts, DTDs were changed. Please
ensure in your projects to include the DTD header as described in the examples
found here</p></div></div><div class="confluence-information-macro
confluence-information-macro-note"><p class="title">Struts 2.0.7 a
nd Prior</p><span class="aui-icon aui-icon-small aui-iconfont-warning
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>The <code>validators.xml</code>
containing custom validators needs to contain a copy of the default validators.
No DTD was used in validators.xml. See: <a shape="rect" class="external-link"
href="http://struts.apache.org/2.x/docs/release-notes-208.html#ReleaseNotes2.0.8-MigrationfrompreviousReleases">http://struts.apache.org/2.x/docs/release-notes-208.html#ReleaseNotes2.0.8-MigrationfrompreviousReleases</a></p></div></div><h2
id="Validation-TurningonValidation">Turning on Validation</h2><p>The default
interceptor stack, "defaultStack", already has validation turned on. When
creating your own interceptor-stack be sure to include <strong>both</strong>
the <code>validation</code> and <code>workflow</code> interceptors. From
<code>struts-default.xml</code>:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="c
odeContent panelContent pdl">
+all the validators you intend to use.</p>The following list shows the default
validators included in the framework and is an example of the syntax used to
declare our own validators.<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"?>
+<!DOCTYPE validators PUBLIC
+ "-//Apache Struts//XWork Validator Definition 1.0//EN"
+
"http://struts.apache.org/dtds/xwork-validator-definition-1.0.dtd">
+
+<validators>
+ <validator name="required"
class="com.opensymphony.xwork2.validator.validators.RequiredFieldValidator"/>
+ <validator name="requiredstring"
class="com.opensymphony.xwork2.validator.validators.RequiredStringValidator"/>
+ <validator name="int"
class="com.opensymphony.xwork2.validator.validators.IntRangeFieldValidator"/>
+ <validator name="long"
class="com.opensymphony.xwork2.validator.validators.LongRangeFieldValidator"/>
+ <validator name="short"
class="com.opensymphony.xwork2.validator.validators.ShortRangeFieldValidator"/>
+ <validator name="double"
class="com.opensymphony.xwork2.validator.validators.DoubleRangeFieldValidator"/>
+ <validator name="date"
class="com.opensymphony.xwork2.validator.validators.DateRangeFieldValidator"/>
+ <validator name="expression"
class="com.opensymphony.xwork2.validator.validators.ExpressionValidator"/>
+ <validator name="fieldexpression"
class="com.opensymphony.xwork2.validator.validators.FieldExpressionValidator"/>
+ <validator name="email"
class="com.opensymphony.xwork2.validator.validators.EmailValidator"/>
+ <validator name="url"
class="com.opensymphony.xwork2.validator.validators.URLValidator"/>
+ <validator name="visitor"
class="com.opensymphony.xwork2.validator.validators.VisitorFieldValidator"/>
+ <validator name="conversion"
class="com.opensymphony.xwork2.validator.validators.ConversionErrorFieldValidator"/>
+ <validator name="stringlength"
class="com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator"/>
+ <validator name="regex"
class="com.opensymphony.xwork2.validator.validators.RegexFieldValidator"/>
+ <validator name="conditionalvisitor"
class="com.opensymphony.xwork2.validator.validators.ConditionalVisitorFieldValidator"/>
+</validators>
+]]></script>
+</div></div><div class="confluence-information-macro
confluence-information-macro-note"><p class="title">Struts 2.1 and
Prior</p><span class="aui-icon aui-icon-small aui-iconfont-warning
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>The <code>validators.xml</code>
used to reference a DTD hosted by Opensymphony, the original location of the
XWork project. Since the the move to Apache Struts, DTDs were changed. Please
ensure in your projects to include the DTD header as described in the examples
found here</p></div></div><div class="confluence-information-macro
confluence-information-macro-note"><p class="title">Struts 2.0.7 and
Prior</p><span class="aui-icon aui-icon-small aui-iconfont-warning
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>The <code>validators.xml</code>
containing custom validators needs to contain a copy of the default validators.
No DTD was used in validators.xml. See: <a sh
ape="rect" class="external-link"
href="http://struts.apache.org/2.x/docs/release-notes-208.html#ReleaseNotes2.0.8-MigrationfrompreviousReleases">http://struts.apache.org/2.x/docs/release-notes-208.html#ReleaseNotes2.0.8-MigrationfrompreviousReleases</a></p></div></div><h2
id="Validation-TurningonValidation">Turning on Validation</h2><p>The default
interceptor stack, "defaultStack", already has validation turned on. When
creating your own interceptor-stack be sure to include <strong>both</strong>
the <code>validation</code> and <code>workflow</code> interceptors. From
<code>struts-default.xml</code>:</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="defaultStack">
...
<interceptor-ref name="validation">
@@ -164,7 +190,7 @@ all the validators you intend to use.</p
</div></div><p>Beginning with version 2.0.4 Struts provides an extension to
XWork's <code>com.opensymphony.xwork2.validator.ValidationInterceptor</code>
interceptor.</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 name="validation"
class="org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor"/>
</pre>
-</div></div><p>This interceptor allows us to turn off validation for a
specific method by using the
<code>@org.apache.struts2.interceptor.validation.SkipValidation</code>
annotation on the action method.</p><h2
id="Validation-ValidatorScopes">Validator Scopes</h2><p>Field validators, as
the name indicate, act on single fields accessible through an action.
+</div></div><p>This interceptor allows us to turn off validation for a
specific method by using the
<code>@org.apache.struts2.interceptor.validation.SkipValidation</code>
annotation on the action method.</p><h2
id="Validation-ValidatorScopes">Validator Scopes</h2><p></p><p>Field
validators, as the name indicate, act on single fields accessible through an
action.
A validator, in contrast, is more generic and can do validations in the full
action context,
involving more than one field (or even no field at all) in validation rule.
Most validations can be defined on per field basis. This should be preferred
over
@@ -173,10 +199,10 @@ related field and will be presented next
respecting view.</p><p>Non-field validators only add action level messages.
Non-field validators
are mostly domain specific and therefore offer custom implementations.
The most important standard non-field validator provided by XWork
-is ExpressionValidator.</p><h3 id="Validation-Notes">Notes</h3><p>Non-field
validators takes precedence over field validators
+is ExpressionValidator.</p><h3
id="Validation-Notes">Notes</h3><p></p><p>Non-field validators takes precedence
over field validators
regardless of the order they are defined in *-validation.xml. If a non-field
validator is short-circuited, it will causes its non-field validator to not
-being executed. See validation framework documentation for more info.</p><h2
id="Validation-DefiningValidationRules">Defining Validation
Rules</h2><p></p><p>Validation rules can be specified:</p>
+being executed. See validation framework documentation for more info.</p><h2
id="Validation-DefiningValidationRules">Defining Validation
Rules</h2><p></p><p></p><p>Validation rules can be specified:</p>
<ol><li> Per Action class: in a file named ActionName-validation.xml</li><li>
Per Action alias: in a file named ActionName-alias-validation.xml</li><li>
Inheritance hierarchy and interfaces implemented by Action class:
XWork searches up the inheritance tree of the action to find default
validations for parent classes of the Action and interfaces
implemented</li></ol>
@@ -226,7 +252,7 @@ Validators (and field-validators) must h
to a name of an Validator registered with the ValidatorFactory as above.
Validator elements may also have <param> elements with name and value
attributes
to set arbitrary parameters into the Validator instance. See below for
discussion
-of the message element.</p><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>In this context, "Action Alias"
refers to the action name as given in the Struts configuration. Often, the name
attribute matches the method name, but they may also differ.</p></div></div><h2
id="Validation-LocalizingandParameterizingMessages">Localizing and
Parameterizing Messages</h2><p></p><p>Each Validator or Field-Validator element
must define one message element inside
+of the message element.</p><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>In this context, "Action Alias"
refers to the action name as given in the Struts configuration. Often, the name
attribute matches the method name, but they may also differ.</p></div></div><h2
id="Validation-LocalizingandParameterizingMessages">Localizing and
Parameterizing Messages</h2><p></p><p></p><p>Each Validator or Field-Validator
element must define one message element inside
the validator element body. The message element has 1 attributes, key which is
not
required. The body of the message tag is taken as the default message which
should
be added to the Action if the validator fails. Key gives a message key to look
up
@@ -267,7 +293,7 @@ Keeping this in mind, it is possible to
<script class="brush: xml; gutter: false; theme: Default"
type="syntaxhighlighter"><![CDATA[
<message>${getText("validation.failednotice")}!
${getText("reason")}:
${getText("validation.inputrequired")}</message>
]]></script>
-</div></div><h2 id="Validation-ValidatorFlavor">Validator
Flavor</h2><p></p><p>The validators supplied by the XWork distribution (and any
validators you
+</div></div><h2 id="Validation-ValidatorFlavor">Validator
Flavor</h2><p></p><p></p><p>The validators supplied by the XWork distribution
(and any validators you
might write yourself) come in two different flavors:</p>
<p></p><ol><li> Plain Validators / Non-Field validators </li><li>
FieldValidators </li></ol>
@@ -335,7 +361,7 @@ to implement.</p><h2 id="Validation-Non-
<message>The email address you entered is not valid.</message>
</validator>
</pre>
-</div></div><h2 id="Validation-Short-CircuitingValidator">Short-Circuiting
Validator</h2><p></p><p>It is possible to short-circuit a stack of validators.
+</div></div><h2 id="Validation-Short-CircuitingValidator">Short-Circuiting
Validator</h2><p></p><p></p><p>It is possible to short-circuit a stack of
validators.
Here is another sample config file containing validation rules from the
Xwork test cases: Notice that some of the <field-validator> and
<validator> elements have the short-circuit attribute set to
true.</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
@@ -422,7 +448,7 @@ By way of example, given this -validatio
"required" validators are FieldValidator's and will not short-circuit the plain
ExpressionValidator because FieldValidators only short-circuit other checks on
that same field. Since the plain Validator is not field specific, it is
-not short-circuited.</p><h2
id="Validation-HowValidatorsofanActionareFound">How Validators of an Action are
Found</h2><p></p><p>As mentioned above, the framework will also search up the
inheritance tree
+not short-circuited.</p><h2
id="Validation-HowValidatorsofanActionareFound">How Validators of an Action are
Found</h2><p></p><p></p><p>As mentioned above, the framework will also search
up the inheritance tree
of the action to find default validations for interfaces and parent classes of
the Action. If you are using the short-circuit attribute and relying on
default validators higher up in the inheritance tree, make sure you don't
Modified: websites/production/struts/content/docs/webxml.html
==============================================================================
--- websites/production/struts/content/docs/webxml.html (original)
+++ websites/production/struts/content/docs/webxml.html Tue Aug 25 07:57:34 2015
@@ -138,7 +138,7 @@ under the License.
<div class="pagecontent">
<div class="wiki-content">
- <div id="ConfluenceContent"><p>The <code>web.xml</code> web
application descriptor file represents the core of the Java web application, so
it is appropriate that it is also part of the core of the Struts framework. In
the <code>web.xml</code> file, Struts defines its FilterDispatcher, the Servlet
Filter class that initializes the Struts framework and handles all requests.
This filter can contain initialization parameters that affect what, if any,
additional configuration files are loaded and how the framework should
behave.</p><p>In addition to the FilterDispatcher, Struts also provides an
ActionContextCleanUp class that handles special cleanup tasks when other
filters, such as those used by Sitemesh, need access to an initialized Struts
framework.</p><h2 id="web.xml-KeyInitializationParameters">Key Initialization
Parameters</h2><p></p><div class="error"><span class="error">Error formatting
macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span>
</div><h2 id="web.xml-SimpleExample">Simple Example</h2><p>Configuring
<code>web.xml</code> for the framework is a matter of adding a filter and
filter-mapping.</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width:
1px;"><b>FilterDispatcher Example (web.xml)</b></div><div class="codeContent
panelContent pdl">
+ <div id="ConfluenceContent"><p>The <code>web.xml</code> web
application descriptor file represents the core of the Java web application, so
it is appropriate that it is also part of the core of the Struts framework. In
the <code>web.xml</code> file, Struts defines its FilterDispatcher, the Servlet
Filter class that initializes the Struts framework and handles all requests.
This filter can contain initialization parameters that affect what, if any,
additional configuration files are loaded and how the framework should
behave.</p><p>In addition to the FilterDispatcher, Struts also provides an
ActionContextCleanUp class that handles special cleanup tasks when other
filters, such as those used by Sitemesh, need access to an initialized Struts
framework.</p><h2 id="web.xml-SimpleExample">Simple Example</h2><p>Configuring
<code>web.xml</code> for the framework is a matter of adding a filter and
filter-mapping.</p><div class="code panel pdl" style="border-width: 1px;"><div
clas
s="codeHeader panelHeader pdl" style="border-bottom-width:
1px;"><b>FilterDispatcher Example (web.xml)</b></div><div class="codeContent
panelContent pdl">
<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><web-app id="WebApp_9" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -146,7 +146,7 @@ under the License.
<filter>
<filter-name>struts2</filter-name>
-
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
+
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>actionPackages</param-name>
<param-value>com.mycompany.myapp.actions</param-value>
@@ -189,7 +189,7 @@ under the License.
</div></div><h2
id="web.xml-CustomFileManagerandFileManagerFactoryimplementations">Custom
FileManager and FileManagerFactory implementations</h2><p>If there is a need to
support an App Server's specific file system (eg. VFS in JBoss), you can
implement your own version of FileManager. But it must be registered at "the
beginning" to support bootstrap of the whole framework.</p><p>To register your
own FileManger you can do it with <init-param/> as below:</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;"><filter>
<filter-name>struts2</filter-name>
-
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
+
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>struts.fileManager</param-name>
<param-value>com.company.MyFileManager</param-value>
@@ -199,7 +199,7 @@ under the License.
</div></div><p>You can as well register your own FileManagerFactory with
<init-param/>, see example:</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;"><filter>
<filter-name>struts2</filter-name>
-
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
+
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>struts.fileManagerFactory</param-name>
<param-value>com.company.MyFileManagerFactory</param-value>