http://git-wip-us.apache.org/repos/asf/struts-site/blob/124e36c4/content/docs/convention-plugin.html
----------------------------------------------------------------------
diff --git a/content/docs/convention-plugin.html 
b/content/docs/convention-plugin.html
new file mode 100644
index 0000000..6468f98
--- /dev/null
+++ b/content/docs/convention-plugin.html
@@ -0,0 +1,582 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
+<!-- 
+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. 
+-->
+<html>
+<head>
+    <link type="text/css" rel="stylesheet" 
href="https://struts.apache.org/css/default.css";>
+    <style type="text/css">
+        .dp-highlighter {
+            width:95% !important;
+        }
+    </style>
+    <style type="text/css">
+        .footer {
+            background-image:      
url('https://cwiki.apache.org/confluence/images/border/border_bottom.gif');
+            background-repeat:     repeat-x;
+            background-position:   left top;
+            padding-top:           4px;
+            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;
+        var children = null;
+
+        function init() {
+            /* Search form initialization */
+            var form = document.forms['search'];
+            if (form != null) {
+                form.elements['domains'].value = location.hostname;
+                form.elements['sitesearch'].value = location.hostname;
+            }
+
+            /* Children initialization */
+            hide = document.getElementById('hide');
+            show = document.getElementById('show');
+            children = document.all != null ?
+                    document.all['children'] :
+                    document.getElementById('children');
+            if (children != null) {
+                children.style.display = 'none';
+                show.style.display = 'inline';
+                hide.style.display = 'none';
+            }
+        }
+
+        function showChildren() {
+            children.style.display = 'block';
+            show.style.display = 'none';
+            hide.style.display = 'inline';
+        }
+
+        function hideChildren() {
+            children.style.display = 'none';
+            show.style.display = 'inline';
+            hide.style.display = 'none';
+        }
+    </script>
+    <title>Convention Plugin</title>
+</head>
+<body onload="init()">
+<table border="0" cellpadding="2" cellspacing="0" width="100%">
+    <tr class="topBar">
+        <td align="left" valign="middle" class="topBarDiv" align="left" nowrap>
+            &nbsp;<a href="home.html">Home</a>&nbsp;&gt;&nbsp;<a 
href="guides.html">Guides</a>&nbsp;&gt;&nbsp;<a 
href="plugin-developers-guide.html">Plugin Developers 
Guide</a>&nbsp;&gt;&nbsp;<a href="convention-plugin.html">Convention Plugin</a>
+        </td>
+        <td align="right" valign="middle" nowrap>
+            <form name="search" action="https://www.google.com/search"; 
method="get">
+                <input type="hidden" name="ie" value="UTF-8" />
+                <input type="hidden" name="oe" value="UTF-8" />
+                <input type="hidden" name="domains" value="" />
+                <input type="hidden" name="sitesearch" value="" />
+                <input type="text" name="q" maxlength="255" value="" />
+                <input type="submit" name="btnG" value="Google Search" />
+            </form>
+        </td>
+    </tr>
+</table>
+
+<div id="PageContent">
+    <div class="pageheader" style="padding: 6px 0px 0px 0px;">
+        <!-- We'll enable this once we figure out how to access (and save) the 
logo resource -->
+        <!--img src="/wiki/images/confluence_logo.gif" style="float: left; 
margin: 4px 4px 4px 10px;" border="0"-->
+        <div style="margin: 0px 10px 0px 10px" class="smalltext">Apache Struts 
2 Documentation</div>
+        <div style="margin: 0px 10px 8px 10px"  class="pagetitle">Convention 
Plugin</div>
+
+        <div class="greynavbar" align="right" style="padding: 2px 10px; 
margin: 0px;">
+            <a 
href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=105613";>
+                <img 
src="https://cwiki.apache.org/confluence/images/icons/notep_16.gif";
+                     height="16" width="16" border="0" align="absmiddle" 
title="Edit Page"></a>
+            <a 
href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=105613";>Edit
 Page</a>
+            &nbsp;
+            <a 
href="https://cwiki.apache.org/confluence/pages/listpages.action?key=WW";>
+                <img 
src="https://cwiki.apache.org/confluence/images/icons/browse_space.gif";
+                     height="16" width="16" border="0" align="absmiddle" 
title="Browse Space"></a>
+            <a 
href="https://cwiki.apache.org/confluence/pages/listpages.action?key=WW";>Browse 
Space</a>
+            &nbsp;
+            <a 
href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=WW&fromPageId=105613";>
+                <img 
src="https://cwiki.apache.org/confluence/images/icons/add_page_16.gif";
+                     height="16" width="16" border="0" align="absmiddle" 
title="Add Page"></a>
+            <a 
href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=WW&fromPageId=105613";>Add
 Page</a>
+            &nbsp;
+            <a 
href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=WW&fromPageId=105613";>
+                <img 
src="https://cwiki.apache.org/confluence/images/icons/add_blogentry_16.gif";
+                     height="16" width="16" border="0" align="absmiddle" 
title="Add News"></a>
+            <a 
href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=WW&fromPageId=105613";>Add
 News</a>
+        </div>
+    </div>
+
+    <div class="pagecontent">
+        <div class="wiki-content">
+            <div id="ConfluenceContent"><p><style type="text/css">/*<![CDATA[*/
+div.rbtoc1488974176161 {padding: 0px;}
+div.rbtoc1488974176161 ul {list-style: none;margin-left: 0px;}
+div.rbtoc1488974176161 li {margin-left: 0px;padding-left: 0px;}
+
+/*]]>*/</style></p><div class="toc-macro rbtoc1488974176161">
+<ul class="toc-indentation"><li><span class="TOCOutline">1</span> <a 
shape="rect" 
href="#ConventionPlugin-Introduction">Introduction</a></li><li><span 
class="TOCOutline">2</span> <a shape="rect" 
href="#ConventionPlugin-Setup">Setup</a></li><li><span 
class="TOCOutline">3</span> <a shape="rect" 
href="#ConventionPlugin-ConvertingaCodebehindbasedapplicationtoConvention">Converting
 a Codebehind based application to Convention</a></li><li><span 
class="TOCOutline">4</span> <a shape="rect" 
href="#ConventionPlugin-Helloworld">Hello world</a></li><li><span 
class="TOCOutline">5</span> <a shape="rect" 
href="#ConventionPlugin-Codebehindhelloworld">Code behind hello 
world</a></li><li><span class="TOCOutline">6</span> <a shape="rect" 
href="#ConventionPlugin-Resultsandresultcodes">Results and result codes</a>
+<ul class="toc-indentation"><li><span class="TOCOutline">6.1</span> <a 
shape="rect" href="#ConventionPlugin-Multiplenames">Multiple names</a></li></ul>
+</li><li><span class="TOCOutline">7</span> <a shape="rect" 
href="#ConventionPlugin-Chaining">Chaining</a></li><li><span 
class="TOCOutline">8</span> <a shape="rect" 
href="#ConventionPlugin-XWorkpackages">XWork packages</a></li><li><span 
class="TOCOutline">9</span> <a shape="rect" 
href="#ConventionPlugin-Annotationreference">Annotation reference</a>
+<ul class="toc-indentation"><li><span class="TOCOutline">9.1</span> <a 
shape="rect" href="#ConventionPlugin-Actionannotation">Action annotation</a>
+<ul class="toc-indentation"><li><span class="TOCOutline">9.1.1</span> <a 
shape="rect" 
href="#ConventionPlugin-Applying@Actionand@Actionsattheclasslevel">Applying 
@Action and @Actions at the class level</a></li></ul>
+</li><li><span class="TOCOutline">9.2</span> <a shape="rect" 
href="#ConventionPlugin-InterceptorRefannotation">InterceptorRef 
annotation</a></li><li><span class="TOCOutline">9.3</span> <a shape="rect" 
href="#ConventionPlugin-Resultannotation">Result annotation</a></li><li><span 
class="TOCOutline">9.4</span> <a shape="rect" 
href="#ConventionPlugin-Namespaceannotation">Namespace 
annotation</a></li><li><span class="TOCOutline">9.5</span> <a shape="rect" 
href="#ConventionPlugin-ResultPathannotation">ResultPath 
annotation</a></li><li><span class="TOCOutline">9.6</span> <a shape="rect" 
href="#ConventionPlugin-ParentPackageannotation">ParentPackage 
annotation</a></li><li><span class="TOCOutline">9.7</span> <a shape="rect" 
href="#ConventionPlugin-ExceptionMappingAnnotation">ExceptionMapping 
Annotation</a></li></ul>
+</li><li><span class="TOCOutline">10</span> <a shape="rect" 
href="#ConventionPlugin-Actionsinjarfiles">Actions in jar 
files</a></li><li><span class="TOCOutline">11</span> <a shape="rect" 
href="#ConventionPlugin-Automaticconfigurationreloading">Automatic 
configuration reloading</a></li><li><span class="TOCOutline">12</span> <a 
shape="rect" href="#ConventionPlugin-JBoss">JBoss</a></li><li><span 
class="TOCOutline">13</span> <a shape="rect" 
href="#ConventionPlugin-Jetty(embedded)">Jetty (embedded)</a></li><li><span 
class="TOCOutline">14</span> <a shape="rect" 
href="#ConventionPlugin-Troubleshooting">Troubleshooting</a>
+<ul class="toc-indentation"><li><span class="TOCOutline">14.1</span> <a 
shape="rect" href="#ConventionPlugin-Tips">Tips</a></li><li><span 
class="TOCOutline">14.2</span> <a shape="rect" 
href="#ConventionPlugin-CommonErrors">Common Errors</a></li></ul>
+</li><li><span class="TOCOutline">15</span> <a shape="rect" 
href="#ConventionPlugin-Overwritingpluginclasses">Overwriting plugin 
classes</a></li><li><span class="TOCOutline">16</span> <a shape="rect" 
href="#ConventionPlugin-Configurationreference">Configuration 
reference</a></li></ul>
+</div><h1 id="ConventionPlugin-Introduction">Introduction</h1><p>The 
Convention Plugin is bundled with Struts since 2.1 and replaces the <a 
shape="rect" href="codebehind-plugin.html">Codebehind Plugin</a> and Zero 
Config plugins. It provides the following features:</p><ul><li>Action location 
by package naming conventions</li><li>Result (JSP, FreeMarker, etc) location by 
naming conventions</li><li>Class name to URL naming convention</li><li>Package 
name to namespace convention</li><li>SEO compliant URLs (i.e. my-action rather 
than MyAction)</li><li>Action name overrides using 
annotations</li><li>Interceptor overrides using annotations</li><li>Namespace 
overrides using annotations</li><li>XWork package overrides using 
annotations</li><li>Default action and result handling (i.e. /products will try 
com.example.actions.Products as well as 
com.example.actions.products.Index)</li></ul><p>The Convention Plugin should 
require no configuration to use. Many of the conventions can be controlled
  using configuration properties and many of the classes can be extended or 
overridden.</p><h1 id="ConventionPlugin-Setup">Setup</h1><p>In order to use the 
Convention plugin, you first need to add the JAR file to the 
<code>WEB-INF/lib</code> directory of your application or include the 
dependency in your project's Maven POM file.</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;">&lt;dependency&gt;
+    &lt;groupId&gt;org.apache.struts&lt;/groupId&gt;
+    &lt;artifactId&gt;struts2-convention-plugin&lt;/artifactId&gt;
+    &lt;version&gt;X.X.X&lt;/version&gt;
+&lt;/dependency&gt;
+</pre>
+</div></div><p>Where X.X.X is the current version of Struts 2. Please remember 
that the Convention Plugin is available from version 2.1.6.</p><h1 
id="ConventionPlugin-ConvertingaCodebehindbasedapplicationtoConvention">Converting
 a Codebehind based application to Convention</h1><p>See <a shape="rect" 
href="converting-application-from-codebehind-to-convention-plugin.html">this 
page</a> for the required changes and tips.</p><p>If you are using REST with 
the Convention plugin, make sure you set these constants in struts.xml:</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;">&lt;constant name="struts.convention.action.suffix" 
value="Controller"/&gt;
+&lt;constant name="struts.convention.action.mapAllMatches" value="true"/&gt;
+&lt;constant name="struts.convention.default.parent.package" 
value="rest-default"/&gt;
+</pre>
+</div></div><h1 id="ConventionPlugin-Helloworld">Hello world</h1><p>Now that 
the Convention plugin has been added to your application, let's start with a 
very simple example. This example will use an actionless result that is 
identified by the URL. By default, the Convention plugin assumes that all of 
the results are stored in <strong>WEB-INF/content</strong>. This can be changed 
by setting the property <code>struts.convention.result.path</code> in the 
Struts properties file to the new location. Don't worry about trailing slashes, 
the Convention plugin handles this for you. Here is our hello world 
JSP:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
+<pre class="brush: html; gutter: false; theme: Default" 
style="font-size:12px;">&lt;html&gt;
+&lt;body&gt;
+Hello world!
+&lt;/body&gt;
+&lt;/html&gt;
+</pre>
+</div></div><p>If you start Tomcat (or whichever J2EE container you are using) 
and type in <a shape="rect" class="external-link" 
href="http://localhost:8080/hello-world"; 
rel="nofollow">http://localhost:8080/hello-world</a>&#160;(assuming that your 
context path is "<code>/</code>", ie. starting application from Eclipse) into 
your browser you should get this result:</p><div class="code panel pdl" 
style="border-style: solid;border-width: 1px;"><div class="codeHeader 
panelHeader pdl" style="border-bottom-width: 1px;border-bottom-style: 
solid;"><b>WEB-INF/content/hello-world.jsp</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">Hello world!
+</pre>
+</div></div><p>This illustrates that the Convention plugin will find results 
even when no action exists and it is all based on the URL passed to 
Struts.</p><h1 id="ConventionPlugin-Codebehindhelloworld">Code behind hello 
world</h1><p>Let's expand on this example and add a code behind class. In order 
to do this we need to ensure that the Convention plugin is able to find our 
action classes. By default, the Convention plugin will find all action classes 
that implement <code>com.opensymphony.xwork2.Action</code> or whose name ends 
with the word <strong>Action</strong> in specific packages.</p><p>These 
packages are located by the Convention plugin using a search methodology. First 
the Convention plugin finds packages named <code>struts</code>, 
<code>struts2</code>, <code>action</code> or <code>actions</code>. Any packages 
that match those names are considered the root packages for the Convention 
plugin. Next, the plugin looks at all of the classes in those packages as well 
as sub-packag
 es and determines if the classes implement 
<code>com.opensymphony.xwork2.Action</code> or if their name ends with 
<strong>Action</strong> (i.e. FooAction). Here's an example of a few classes 
that the Convention plugin will find:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 1px;"><b>Classes</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">com.example.actions.MainAction
+com.example.actions.products.Display (implements 
com.opensymphony.xwork2.Action)
+com.example.struts.company.details.ShowCompanyDetailsAction
+</pre>
+</div></div><p>Each of the action classes that the plugin finds will be 
configured to respond to specific URLs. The URL is based on the package name 
that the class is defined in and the class name itself. First the plugin 
determines the namespace of the URL using the package names between the root 
package and the package the class is defined in. For our examples above, the 
namespaces would be:</p><div class="code panel pdl" style="border-width: 
1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>Namespaces</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">com.example.actions.MainAction -&gt; /
+com.example.actions.products.Display -&gt; /products
+com.example.struts.company.details.ShowCompanyDetailsAction -&gt; 
/company/details
+</pre>
+</div></div><p>Next, the plugin determines the URL of the resource using the 
class name. It first removes the word <strong>Action</strong> from the end of 
the class name and then converts camel case names to dashes. In our example the 
full URLs would be:</p><div class="code panel pdl" style="border-width: 
1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>Full URLs</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">com.example.actions.MainAction -&gt; /main
+com.example.actions.products.Display -&gt; /products/display
+com.example.struts.company.details.ShowCompanyDetailsAction -&gt; 
/company/details/show-company-details
+</pre>
+</div></div><p>You can tell the Convention plugin to ignore certain packages 
using the property <code>struts.convention.exclude.packages</code>. You can 
also tell the plugin to use different strings to locate root packages using the 
property <code>struts.convention.package.locators</code>. Finally, you can tell 
the plugin to search specific root packages using the property 
<code>struts.convention.action.packages</code>.</p><p>Here is our code behind 
action class:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>com.example.actions.HelloWorld</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">package com.example.actions;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class HelloWorld extends ActionSupport {
+  private String message;
+
+  public String getMessage() {
+    return message;
+  }
+
+  public String execute() {
+    message = "Hello World!";
+    return SUCCESS;
+  }
+}
+</pre>
+</div></div><p>If you compile this class and place it into your application in 
the WEB-INF/classes, the Convention plugin will find the class and map the URL 
<strong>/hello-world</strong> to it. Next, we need to update our JSP to print 
out the message we setup in the action class. Here is the new JSP:</p><div 
class="code panel pdl" style="border-style: solid;border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;border-bottom-style: 
solid;"><b>WEB-INF/content/hello-world.jsp</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">&lt;html&gt;
+&lt;body&gt;
+The message is ${message}
+&lt;/body&gt;
+&lt;/html&gt;
+</pre>
+</div></div><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>Please notice that the expression 
<code>${message</code><span>}</span> will work without adding JSP directive 
<code>isELIgnored="false"</code>.</p></div></div><p>&#160;</p><p>If start up 
the application server and open up <a shape="rect" class="external-link" 
href="http://localhost:8080/hello-world"; 
rel="nofollow">http://localhost:8080/hello-world</a> in our browser, we should 
get this result:</p><div class="code panel pdl" style="border-style: 
solid;border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 1px;border-bottom-style: 
solid;"><b>Result</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">The message is Hello World!
+</pre>
+</div></div><h1 id="ConventionPlugin-Resultsandresultcodes">Results and result 
codes</h1><p>The Convention Plugin will pre-configure all of you action classes 
when Struts is started. By default, this configuration will also contain 
results for any JSPs that it can find within the application. The JSPs have an 
additional feature that allows different JSPs to be used based on the result 
code of the action. Since action methods return Strings and these Strings are 
traditionally used to locate results for the action, the Convention plugin 
allows you to define different results based on the result code.</p><p>Building 
on our example from above, let's say we want to provide a different result if 
the result code from our action is the String <code>zero</code> rather than 
<code>success</code>. First, we update the action class to return different 
result codes:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;">
 <b>com.example.actions.HelloWorld</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">package com.example.actions;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class HelloWorld extends ActionSupport {
+  private String message;
+
+  public String getMessage() {
+    return message;
+  }
+
+  public String execute() {
+    if (System.currentTimeMillis() % 2 == 0) {
+      message = "It's 0";
+      return "zero";
+    }
+
+    message = "It's 1";
+    return SUCCESS;
+  }
+}
+</pre>
+</div></div><p>Next, we add a new JSP to the application named 
<code>WEB-INF/content/hello-world-zero.jsp</code>. Notice that the first part 
of the file name is the same as the URL of the action and the last part of the 
name is the result code. This is the convention that the plugin uses to 
determine which results to render. Here is our new JSP:</p><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 
1px;"><b>WEB-INF/content/hello-world.jsp</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">&lt;html&gt;
+&lt;body&gt;
+The error message is ${message}
+&lt;/body&gt;
+&lt;/html&gt;
+</pre>
+</div></div><p>Now, if you compile the action and restart the application, 
based on the current time, you'll either see the result from 
<code>WEB-INF/content/hello-world.jsp</code> or 
<code>WEB-INF/content/hello-world-zero.jsp</code>.</p><p>The result type is 
based on the extension of the file. The supported extensions are: 
jsp,ftl,vm,html,html. Examples of Action and Result to Template 
mapping:</p><div class="table-wrap"><table 
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"><p>URL</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Result</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>File that could match</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Result Type</p></th></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p>/hello</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>success</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>/WEB-INF/content/hello.jsp</p></td><td colspan="
 1" rowspan="1" class="confluenceTd"><p>Dispatcher</p></td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p>/hello</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>success</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>/WEB-INF/content/hello-success.htm</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>Dispatcher</p></td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p>/hello</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>success</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>/WEB-INF/content/hello.ftl</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>FreeMarker</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p>/hello-world</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>input</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>/WEB-INF/content/hello-world-input.vm</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>Velocity</p></td></tr><tr><td
  colspan="1" rowspan="1" 
class="confluenceTd"><p>/test1/test2/hello</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>error</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>/WEB-INF/content/test/test2/hello-error.html</p></td><td
 colspan="1" rowspan="1" 
class="confluenceTd"><p>Dispatcher</p></td></tr></tbody></table></div><h3 
id="ConventionPlugin-Multiplenames">Multiple names</h3><p>It is possible to 
define multiple names for the same result:</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;">@Action(results = {
+    @Result(name={"error", "input"}, location="input-form.jsp"),
+    @Result(name="success", location="success.jsp")
+})</pre>
+</div></div><p><span style="line-height: 1.42857;">Such functionality was 
added in Struts 2.5</span></p><h1 
id="ConventionPlugin-Chaining">Chaining</h1><p>If one action returns the name 
of another action in the same package, they will be chained together, if the 
first action doesn't have any result defined for that code. In the following 
example:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>com.example.actions.HelloWorld</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">package com.example.actions;
+
+import com.opensymphony.xwork2.Action;
+import com.opensymphony.xwork2.ActionSupport;
+
+public class HelloAction extends ActionSupport {
+    @Action("foo")
+    public String foo() {
+        return "bar";
+    }
+
+    @Action("foo-bar")
+    public String bar() {
+        return SUCCESS;
+    }
+}
+</pre>
+</div></div><p>The "foo" action will be executed, because no result is found, 
the Convention plugin tries to find an action named "foo-bar" on the same 
package where "foo" is defined. If such an action is found, it will be invoked 
using the "chain" result.</p><h1 id="ConventionPlugin-XWorkpackages">XWork 
packages</h1><p>Actions are placed on a custom XWork package which prevents 
conflicts. The name of this package is based on the Java package the action is 
defined in, the namespace part of the URL for the action and the parent XWork 
package for the action. The parent XWork package is determined based on the 
property named <code>struts.convention.default.parent.package</code>(defaults 
to <code>convention-default</code>), which is a custom XWork package that 
extends <code>struts-default</code>.</p><p>Therefore the naming for XWork 
packages used by the Convention plugin are in the form:</p><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" st
 yle="border-bottom-width: 1px;"><b>XWork package naming</b></div><div 
class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">&lt;java-package&gt;#&lt;namespace&gt;#&lt;parent-package&gt;
+</pre>
+</div></div><p>Using our example from above, the XWork package for our action 
would be:</p><div class="code panel pdl" style="border-style: 
solid;border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 1px;border-bottom-style: solid;"><b>XWork package 
naming</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">com.example.actions#/#conventionDefault
+</pre>
+</div></div><h1 id="ConventionPlugin-Annotationreference">Annotation 
reference</h1><p>The Convention plugin uses a number of different annotations 
to override the default conventions that are used to map actions to URLs and 
locate results. In addition, you can modify the parent XWork package that 
actions are configured with.</p><h2 
id="ConventionPlugin-Actionannotation">Action annotation</h2><p>The Convention 
plugin allows action classes to change the URL that they are mapped to using 
the <strong>Action</strong> annotation. This annotation can also be used inside 
the <strong>Actions</strong> annotation to allow multiple URLs to map to a 
single action class. This annotation must be defined on action methods like 
this:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>com.example.actions.HelloWorld</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">package com.example.actions;
+
+import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.convention.annotation.Action;
+
+public class HelloWorld extends ActionSupport {
+  @Action("/different/url")
+  public String execute() {
+    return SUCCESS;
+  }
+}
+</pre>
+</div></div><p>Our action class will now map to the URL 
<code>/different/url</code> rather than <code>/hello-world</code>. If no 
<code>@Result</code> (see next section) is specified, then the namespace of the 
action will be used as the path to the result, on our last example it would be 
<code>/WEB-INF/content/different/url.jsp</code>.</p><p>A single method within 
an action class can also map to multiple URLs using the 
<strong>Actions</strong> annotation like this:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 
1px;"><b>com.example.actions.HelloWorld</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">package com.example.actions;
+
+import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.convention.annotation.Action;
+import org.apache.struts2.convention.annotation.Actions;
+
+public class HelloWorld extends ActionSupport {
+  @Actions({
+    @Action("/different/url"),
+    @Action("/another/url")
+  })
+  public String execute() {
+    return SUCCESS;
+  }
+}
+</pre>
+</div></div><p>Another usage of the <strong>Action</strong> or 
<strong>Actions</strong> annotation is to define multiple action methods within 
a single action class, each of which respond to a different URL. Here is an 
example of multiple action methods:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 
1px;"><b>com.example.actions.HelloWorld</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">package com.example.actions;
+
+import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.convention.annotation.Action;
+import org.apache.struts2.convention.annotation.Actions;
+
+public class HelloWorld extends ActionSupport {
+  @Action("/different/url")
+  public String execute() {
+    return SUCCESS;
+
+
+  }
+
+  @Action("url")
+  public String doSomething() {
+    return SUCCESS;
+  }
+}
+</pre>
+</div></div><p>The previous example defines a second URL that is not fully 
qualified. This means that the namespace for the URL is determined using the 
Java package name rather than the Action annotation.</p><p>Interceptor and 
interceptor stacks can be specified using the <code>interceptorRefs</code> 
attribute. The following example applies the <code>validation</code> 
interceptor and the <code>defaultStack</code> interceptor stack to the 
action:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>com.example.actions.HelloWorld</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">package com.example.actions;
+
+import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.convention.annotation.Action;
+import org.apache.struts2.convention.annotation.Actions;
+
+public class HelloWorld extends ActionSupport {
+  @Action(interceptorRefs={@InterceptorRef("validation"), 
@InterceptorRef("defaultStack")})
+  public String execute() {
+    return SUCCESS;
+  }
+
+  @Action("url")
+  public String doSomething() {
+    return SUCCESS;
+  }
+}
+</pre>
+</div></div><p>Parameters can be passed to results using the 
<strong>params</strong> attribute. The value of this attribute is a string 
array with an even number of elements in the form {"key0", "value0, "key1", 
"value1" ... "keyN", "valueN"}. For example:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 
1px;"><b>com.example.actions.HelloWorld</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">package com.example.actions;
+
+import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.convention.annotation.Action;
+import org.apache.struts2.convention.annotation.Actions;
+
+public class HelloWorld extends ActionSupport {
+  
@Action(interceptorRefs=@InterceptorRef(value="validation",params={"programmatic",
 "false", "declarative", "true}))
+  public String execute() {
+    return SUCCESS;
+  }
+
+  @Action("url")
+  public String doSomething() {
+    return SUCCESS;
+  }
+}
+</pre>
+</div></div><p>If interceptors are not specified, the default stack is 
applied.</p><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>You can specify className 
parameter which can be especially useful when Spring Framework is used to 
instantiate actions.</p></div></div><h3 
id="ConventionPlugin-Applying@Actionand@Actionsattheclasslevel">Applying 
@Action and @Actions at the class level</h3><p>There are circumstances when 
this is desired, like when using <a shape="rect" 
href="action-configuration.html">Dynamic Method Invocation</a>. If an 
<code>execute</code> method is defined in the class, then it will be used for 
the action mapping, otherwise the method to be used will be determined when a 
request is made (by Dynamic Method Invocation for example)</p><h2 
id="ConventionPlugin-InterceptorRefannotation">Interce
 ptorRef annotation</h2><p>Interceptors can be specified at the method level, 
using the <strong>Action</strong> annotation or at the class level using the 
<code>InterceptorRefs</code> annotation. Interceptors specified at the class 
level will be applied to all actions defined on that class. In the following 
example:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>com.example.actions.HelloWorld</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">package com.example.actions;
+
+import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.convention.annotation.Action;
+import org.apache.struts2.convention.annotation.Actions;
+
+@InterceptorRefs({
+    @InterceptorRef("interceptor-1"),
+    @InterceptorRef("defaultStack")
+})
+public class HelloWorld extends ActionSupport {
+  @Action(value="action1", interceptorRefs=@InterceptorRef("validation"))
+  public String execute() {
+    return SUCCESS;
+  }
+
+  @Action(value="action2")
+  public String doSomething() {
+    return SUCCESS;
+  }
+}
+</pre>
+</div></div><p>The following interceptors will be applied to "action1": 
<code>interceptor-1</code>, all interceptors from <code>defaultStack</code>, 
<code>validation</code>.<br clear="none"> All interceptors from 
<code>defaultStack</code> will be applied to "action2".</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>If you get errors like "Unable to 
find interceptor class referenced by ref-name XYZ". This means that the package 
where Convention is placing your actions, does not extend the package where the 
interceptor is defined. To fix this problem either 1)Use @ParentPackage 
annotation(or <code>struts.convention.default.parent.package</code>) passing 
the name of the package that defines the interceptor, or 2) Create a package in 
XML that extends the package that defines the interceptor, and use @ParentPa
 ckage(or <code>struts.convention.default.parent.package</code>) to point to 
it.</p></div></div><h2 id="ConventionPlugin-Resultannotation">Result 
annotation</h2><p>The Convention plugin allows action classes to define 
different results for an action. Results fall into two categories, global and 
local. Global results are shared across all actions defined within the action 
class. These results are defined as annotations on the action class. Local 
results apply only to the action method they are defined on. Here is an example 
of the different types of result annotations:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 
1px;"><b>com.example.actions.HelloWorld</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">package com.example.actions;
+
+import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.convention.annotation.Action;
+import org.apache.struts2.convention.annotation.Actions;
+import org.apache.struts2.convention.annotation.Result;
+import org.apache.struts2.convention.annotation.Results;
+
+@Results({
+  @Result(name="failure", location="fail.jsp")
+})
+public class HelloWorld extends ActionSupport {
+  @Action(value="/different/url",
+    results={@Result(name="success", location="http://struts.apache.org";, 
type="redirect")}
+  )
+  public String execute() {
+    return SUCCESS;
+  }
+
+  @Action("/another/url")
+
+  public String doSomething() {
+    return SUCCESS;
+  }
+}
+</pre>
+</div></div><p>Parameters can be passed to results using the 
<strong>params</strong> attribute. The value of this attribute is a string 
array with an even number of elements in the form {"key0", "value0, "key1", 
"value1" ... "keyN", "valueN"}. For example:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 
1px;"><b>com.example.actions.HelloWorld</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">package com.example.actions;
+
+import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.convention.annotation.Action;
+import org.apache.struts2.convention.annotation.Actions;
+import org.apache.struts2.convention.annotation.Result;
+import org.apache.struts2.convention.annotation.Results;
+
+public class HelloWorld extends ActionSupport {
+  @Action(value="/different/url",
+    results={@Result(name="success", type="httpheader", params={"status", 
"500", "errorMessage", "Internal Error"})}
+  )
+  public String execute() {
+    return SUCCESS;
+  }
+
+  @Action("/another/url")
+  public String doSomething() {
+    return SUCCESS;
+  }
+}
+</pre>
+</div></div><p>From 2.1.7 on, global results (defined on the class level) 
defined using annotations will be inherited. Child classes can override the 
inherited result(s) by redefining it. Also, results defined at the method level 
take precedence (overwrite), over results with the same name at the action 
level.</p><h2 id="ConventionPlugin-Namespaceannotation">Namespace 
annotation</h2><p>The namespace annotation allows the namespace for action 
classes to be changed instead of using the convention of the Java package name. 
This annotation can be placed on an action class or within the 
package-info.java class that allows annotations to be placed on Java packages. 
When this annotation is put on an action class, it applies to all actions 
defined in the class, that are not fully qualified action URLs. When this 
annotation is place in the package-info.java file, it changes the default 
namespace for all actions defined in the Java package. Here is an example of 
the annotation on an action cl
 ass:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>com.example.actions.HelloWorl</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">package com.example.actions;
+
+import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.convention.annotation.Action;
+import org.apache.struts2.convention.annotation.Namespace;
+
+@Namespace("/custom")
+public class HelloWorld extends ActionSupport {
+  @Action("/different/url")
+  public String execute() {
+    return SUCCESS;
+  }
+
+  @Action("url")
+  public String doSomething() {
+    return SUCCESS;
+  }
+}
+</pre>
+</div></div><p>In this example, the action will respond to two different URLs 
<code>/different/url</code> and <code>/custom/url</code>.</p><p>Here is an 
example of using this annotation in the package-info.java file:</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeHeader 
panelHeader pdl" style="border-bottom-width: 
1px;"><b>com/example/actions/package-info.java</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@org.apache.struts2.convention.annotation.Namespace("/custom")
+package com.example.actions;
+</pre>
+</div></div><p>This changes the default namespace for all actions defined in 
the package <code>com.example.actions</code>. This annotation however doesn't 
apply to sub-packages.</p><h2 
id="ConventionPlugin-ResultPathannotation">ResultPath annotation</h2><p>The 
ResultPath annotation allows applications to change the location where results 
are stored. This annotation can be placed on an action class and also in the 
package-info.java file. Here is an example of using this annotation:</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeHeader 
panelHeader pdl" style="border-bottom-width: 
1px;"><b>com.example.actions.HelloWorl</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">package com.example.actions;
+
+import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.convention.annotation.Action;
+import org.apache.struts2.convention.annotation.ResultPath;
+
+@ResultPath("/WEB-INF/jsps")
+public class HelloWorld extends ActionSupport {
+  public String execute() {
+    return SUCCESS;
+  }
+}
+</pre>
+</div></div><p>The result for this class will be located in 
<code>WEB-INF/jsps</code> rather than the default of 
<code>WEB-INF/content</code>.</p><h2 
id="ConventionPlugin-ParentPackageannotation">ParentPackage 
annotation</h2><p>The ParentPackage annotation allows applications to define 
different parent Struts package for specific action classes or Java packages. 
Here is an example of using the annotation on an action class:</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeHeader 
panelHeader pdl" style="border-bottom-width: 
1px;"><b>com.example.actions.HelloWorld</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">package com.example.actions;
+
+import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.convention.annotation.Action;
+import org.apache.struts2.convention.annotation.ParentPackage;
+
+@ParentPackage("customXWorkPackage")
+public class HelloWorld extends ActionSupport {
+  public String execute() {
+    return SUCCESS;
+  }
+}
+</pre>
+</div></div><p>To apply this annotation to all actions in a package (and 
subpackages), add it to package-info.java. An alternative to this annotation is 
to set <code>struts.convention.default.parent.package</code> in XML.</p><h2 
id="ConventionPlugin-ExceptionMappingAnnotation">ExceptionMapping 
Annotation</h2><p>This annotation can be used to define exception mappings to 
actions. See the <a shape="rect" href="exception-configuration.html">exception 
mapping documentation</a> for more details. These mappings can be applied to 
the class level, in which case they will be applied to all actions defined on 
that class:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>ExceptionsActionLevelAction.java</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@ExceptionMappings({
+    @ExceptionMapping(exception = "java.lang.NullPointerException", result = 
"success", params = {"param1", "val1"})
+})
+public class ExceptionsActionLevelAction {
+
+    public String execute() throws Exception {
+        return null;
+    }
+}
+</pre>
+</div></div><p>The parameters defined by <code>params</code> are passed to the 
result. Exception mappings can also be applied to the action level:</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;">public class ExceptionsMethodLevelAction {
+    @Action(value = "exception1", exceptionMappings = {
+            @ExceptionMapping(exception = "java.lang.NullPointerException", 
result = "success", params = {"param1", "val1"})
+    })
+    public String run1() throws Exception {
+        return null;
+    }
+}
+</pre>
+</div></div><h1 id="ConventionPlugin-Actionsinjarfiles">Actions in jar 
files</h1><p>By default the Convention plugin will <strong>not</strong> scan 
jar files for actions. For a jar to be scanned, its URL needs to match at least 
one of the regular expressions in 
<code>struts.convention.action.includeJars</code>. In this example 
<code>myjar1.jar</code> and <code>myjar2.jar</code> will be scanned:</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;">&lt;constant 
name="struts.convention.action.includeJars" 
value=".*?/myjar1.*?jar(!/)?,.*?/myjar2*?jar(!/)?"
+</pre>
+</div></div><p>Note that <strong>the regular expression will be evaluated 
against the URL of the jar, and not the file name</strong>, the jar URL can 
contain a path to the jar file and a trailing "!/".</p><h1 
id="ConventionPlugin-Automaticconfigurationreloading">Automatic configuration 
reloading</h1><p>The Convention plugin can automatically reload configuration 
changes, made in classes the contain actions, without restarting the container. 
This is a similar behavior to the automatic xml configuration reloading. To 
enable this feature, add this to your <code>struts.xml</code> file:</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;">&lt;constant name="struts.devMode" value="true"/&gt;
+&lt;constant name="struts.convention.classes.reload" value="true" /&gt;
+</pre>
+</div></div><p>This feature is experimental and has not been tested on all 
container, and it is <strong>strongly</strong> advised not to use it in 
production environments.</p><h1 id="ConventionPlugin-JBoss">JBoss</h1><p>When 
using this plugin with JBoss, you need to set the following constants:</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;">&lt;constant 
name="struts.convention.exclude.parentClassLoader" value="true" /&gt;
+&lt;constant name="struts.convention.action.fileProtocols" 
value="jar,vfsfile,vfszip" /&gt;
+</pre>
+</div></div><p>You can also check the <a shape="rect" 
href="jboss-5.html">JBoss 5</a>&#160;page for more details.</p><h1 
id="ConventionPlugin-Jetty(embedded)">Jetty (embedded)</h1><p>When using this 
plugin with Jetty in embedded mode, you need to set the following 
constants:</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;">&lt;constant 
name="struts.convention.exclude.parentClassLoader" value="false" /&gt;
+&lt;constant name="struts.convention.action.fileProtocols" 
value="jar,code-source" /&gt;
+</pre>
+</div></div><h1 id="ConventionPlugin-Troubleshooting">Troubleshooting</h1><h2 
id="ConventionPlugin-Tips">Tips</h2><div class="confluence-information-macro 
confluence-information-macro-tip"><p class="title">Namespaces and 
Results</p><span class="aui-icon aui-icon-small aui-iconfont-approve 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>Make sure the namespace of the 
action is matched by one of the locators. The rest of the namespace after the 
locator, will be the namespace of the action, and will be used to find the 
results. For example, a class called "ViewAction" in the package 
"my.example.actions.orders" will be mapped to the URL 
<code>/orders/view.action</code>, and the results must be under 
<code>/WEB-INF/content/orders</code>, like 
<code>/WEB-INF/content/orders/view-success.jsp</code>.</p></div></div><div 
class="confluence-information-macro confluence-information-macro-tip"><p 
class="title">Use the Configuration Browser Plugin</p><sp
 an class="aui-icon aui-icon-small aui-iconfont-approve 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>Add the <a shape="rect" 
href="config-browser-plugin.html">Config Browser Plugin</a> plugin to the lib 
folder or maven dependencies, and then visit: <a shape="rect" 
class="external-link" 
href="http://localhost:8080/CONTEXT/config-browser/index.action"; 
rel="nofollow">http://localhost:8080/CONTEXT/config-browser/index.action</a>, 
to see the current action mappings.</p></div></div><div 
class="confluence-information-macro confluence-information-macro-tip"><p 
class="title">Enable trace or debug mode</p><span class="aui-icon 
aui-icon-small aui-iconfont-approve 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>The Convention plugin can generate 
a rather verbose output when set to debug mode for logging. Use "Trace" logging 
level if you are using the JDK logger. If you are using Log4J, you can do 
something
  
like:</p><p>log4j.logger.org.apache.struts2.convention=DEBUG</p></div></div><h2 
id="ConventionPlugin-CommonErrors">Common Errors</h2><ol><li>I get an error 
like "There is no Action mapped for namespace /orders and action name view.". 
This means that the URL <code>/orders/view.action</code> is not mapping to any 
action class. Check the namespace and the name of the action.</li><li>I get an 
error like "No result defined for action my.example.actions.orders.ViewAction 
and result success". This means that the action was mapped to the right URL, 
but the Convention plugin was unable to find a <code>success</code> result for 
it. Check that the result file exists, like 
<code>/WEB-INF/content/orders/view-success.jsp</code>.</li><li>I get lots of 
errors like "java.lang.Exception: Could not load 
org/apache/velocity/runtime/resource/loader/ClasspathResourceLoader.class". 
This happens when <code>struts.convention.action.includeJars</code> is matching 
jar URLs from external jars.</li><li>I am us
 ing a custom interceptor stack and I get an error like "Unable to find 
interceptor class referenced by ref-name XYZ". This means that the package 
where Convention is placing your actions, does not extend the package where the 
interceptor is defined. To fix this problem either 1)Use @ParentPackage 
annotation(or <code>struts.convention.default.parent.package</code>) passing 
the name of the package that defines the interceptor, or 2) Create a package in 
XML that extends the package that defines the interceptor, and use 
@ParentPackage(or <code>struts.convention.default.parent.package</code>) to 
point to it.</li></ol><h1 
id="ConventionPlugin-Overwritingpluginclasses">Overwriting plugin 
classes</h1><p>The Convention plugin can be extended in the same fashion that 
Struts does. The following beans are defined by default:</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;">&lt;bean 
type="org.apache.struts2.convention.ActionConfigBuilder" name="convention" 
class="org.apache.struts2.convention.PackageBasedActionConfigBuilder"/&gt;
+This interface defines how the action configurations for the current web 
application can be constructed. This must find all actions that are not 
specifically defined in the struts XML files or any plugins. Furthermore, it 
must make every effort to locate all action results as well.
+
+&lt;bean type="org.apache.struts2.convention.ActionNameBuilder" 
name="convention" 
class="org.apache.struts2.convention.SEOActionNameBuilder"/&gt;
+This interface defines the method that is used to create action names based on 
the name of a class.
+
+&lt;bean type="org.apache.struts2.convention.ResultMapBuilder" 
name="convention" 
class="org.apache.struts2.convention.DefaultResultMapBuilder"/&gt;
+This interface defines how results are constructed for an Action. The action 
information is supplied and the result is a mapping of ResultConfig instances 
to the result name.
+
+&lt;bean type="org.apache.struts2.convention.InterceptorMapBuilder" 
name="convention" 
class="org.apache.struts2.convention.DefaultInterceptorMapBuilder"/&gt;
+This interface defines how interceptors are built from annotations.
+
+&lt;bean type="org.apache.struts2.convention.ConventionsService" 
name="convention" 
class="org.apache.struts2.convention.ConventionsServiceImpl"/&gt;
+This interface defines the conventions that are used by the convention plugin. 
In most cases the methods on this class will provide the best default for any 
values and also handle locating overrides of the default via the annotations 
that are part of the plugin.
+
+&lt;constant name="struts.convention.actionConfigBuilder" 
value="convention"/&gt;
+&lt;constant name="struts.convention.actionNameBuilder" value="convention"/&gt;
+&lt;constant name="struts.convention.resultMapBuilder" value="convention"/&gt;
+&lt;constant name="struts.convention.interceptorMapBuilder" 
value="convention"/&gt;
+&lt;constant name="struts.convention.conventionsService" 
value="convention"/&gt;
+</pre>
+</div></div><p>To plugin a different implementation for one of these classes, 
implement the interface, define a bean for it, and set the appropriate 
constant's value with the name of the new bean, for 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;">&lt;bean 
type="org.apache.struts2.convention.ActionNameBuilder" 
name="MyActionNameBuilder" class="example.SultansOfSwingNameBuilder"/&gt;
+&lt;constant name="struts.convention.actionNameBuilder" 
value="MyActionNameBuilder"/&gt;
+</pre>
+</div></div><h1 id="ConventionPlugin-Configurationreference">Configuration 
reference</h1><p>Add a <strong>constant</strong> element to your struts config 
file to change the value of a configuration setting, like:</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;">&lt;constant name="struts.convention.result.path" 
value="/WEB-INF/mytemplates/"/&gt;
+</pre>
+</div></div><div class="table-wrap"><table 
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
rowspan="1" 
class="confluenceTd"><p>struts.convention.action.alwaysMapExecute</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>true</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Set to false, to prevent Convention from 
creating a default mapping to "execute" when there are other methods annotated 
as actions in the class</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>struts.convention.action.includeJars</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Comma separated list of regular expressions 
of jar URLs to be scanned. eg. ".<strong>myJar-0\.2.</stron
 g>,.<strong>thirdparty-0\.1.</strong>"</p></td></tr><tr><td colspan="1" 
rowspan="1" 
class="confluenceTd"><p>struts.convention.action.packages</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>An optional list of action packages that 
this should create configuration for (they don't need to match a locator 
pattern)</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>struts.convention.result.path</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>/WEB-INF/content/</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Directory where templates are 
located</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>struts.convention.result.flatLayout</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>true</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>If set to false, the result can be put in 
its own directory: resultsRoot/namespace/actionName/result
 .extension</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>struts.convention.action.suffix</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Action</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Suffix used to find actions based on class 
names</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>struts.convention.action.disableScanning</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>false</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Scan packages for 
actions</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>struts.convention.action.mapAllMatches</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>false</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Create action mappings, even if no @Action 
is found</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>struts.convention.action.checkImplementsAction</p></td><td
 colspan="1" rowspan="1" class="co
 nfluenceTd"><p>true</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Check if an action implements 
com.opensymphony.xwork2.Action to create an action mapping</p></td></tr><tr><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p>struts.convention.default.parent.package</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>convention-default</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>Default parent package for 
action mappins</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>struts.convention.action.name.lowercase</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>true</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Convert action name to 
lowercase</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>struts.convention.action.name.separator</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>-</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Separator used to build the action name
 , MyAction -&gt; my-action. This character is also used as the separator 
between the action name and the result in templates, like 
action-result.jsp</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>struts.convention.package.locators</p></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p>action,actions,struts,struts2</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Packages whose name end with one of these 
strings will be scanned for actions</p></td></tr><tr><td colspan="1" 
rowspan="1" 
class="confluenceTd"><p>struts.convention.package.locators.disable</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>false</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Disable the scanning of packages based on 
package locators</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>struts.convention.exclude.packages</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>org.apache.struts.*, <br 
clear="none" class="atl-forced
 -newline"> org.apache.struts2.*, <br clear="none" class="atl-forced-newline"> 
org.springframework.web.struts.*, <br clear="none" class="atl-forced-newline"> 
org.springframework.web.struts2.*, <br clear="none" class="atl-forced-newline"> 
org.hibernate.*</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Packages excluded from the action scanning, packages 
already excluded cannot be included in other way, eg. org.demo.actions.exclude 
is specified as a part of the struts.convention.exclude.packages so all 
packages below are also excluded, eg. org.demo.actions.exclude.include even if 
<strong>include</strong> is specified as a struts.convention.package.locators 
or struts.convention.action.packages</p></td></tr><tr><td colspan="1" 
rowspan="1" 
class="confluenceTd"><p>struts.convention.package.locators.basePackage</p></td><td
 colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>If set, only packages that start with its v
 alue will be scanned for actions</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>struts.convention.relative.result.types</p></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p>dispatcher,velocity,freemarker</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>The list of result types that can have 
locations that are relative and the result location (which is the resultPath 
plus the namespace) prepended to them</p></td></tr><tr><td colspan="1" 
rowspan="1" 
class="confluenceTd"><p>struts.convention.redirect.to.slash</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>true</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>A boolean parameter that controls whether 
or not this will handle unknown actions in the same manner as Apache, Tomcat 
and other web servers. This handling will send back a redirect for URLs such as 
/foo to /foo/ if there doesn't exist an action that responds to 
/foo</p></td></tr><tr><td colspan="1" rowspan="1" class="
 confluenceTd"><p>struts.convention.classLoader.excludeParent</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>true</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Exclude URLs found by the parent class 
loader from the list of URLs scanned to find actions (needs to be set to 
<code>false</code> for JBoss 5)</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>struts.convention.action.eagerLoading</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>false</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>If set, found action classes will be 
instantiated by the ObjectFactory to accelerate future use, setting it up can 
clash with Spring managed beans</p></td></tr></tbody></table></div></div>
+        </div>
+
+                    <div class="tabletitle">
+                Children
+            <span class="smalltext" id="show" style="display: inline;">
+              <a href="javascript:showChildren()">Show Children</a></span>
+            <span class="smalltext" id="hide" style="display: none;">
+              <a href="javascript:hideChildren()">Hide Children</a></span>
+            </div>
+            <div class="greybox" id="children" style="display: none;">
+                                                    $page.link($child)
+                    <span class="smalltext">(Apache Struts 2 
Documentation)</span>
+                    <br>
+                            </div>
+        
+    </div>
+</div>
+<div class="footer">
+    Generated by CXF SiteExporter
+</div>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/struts-site/blob/124e36c4/content/docs/conversion-annotation.html
----------------------------------------------------------------------
diff --git a/content/docs/conversion-annotation.html 
b/content/docs/conversion-annotation.html
new file mode 100644
index 0000000..020ae83
--- /dev/null
+++ b/content/docs/conversion-annotation.html
@@ -0,0 +1,189 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
+<!-- 
+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. 
+-->
+<html>
+<head>
+    <link type="text/css" rel="stylesheet" 
href="https://struts.apache.org/css/default.css";>
+    <style type="text/css">
+        .dp-highlighter {
+            width:95% !important;
+        }
+    </style>
+    <style type="text/css">
+        .footer {
+            background-image:      
url('https://cwiki.apache.org/confluence/images/border/border_bottom.gif');
+            background-repeat:     repeat-x;
+            background-position:   left top;
+            padding-top:           4px;
+            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;
+        var children = null;
+
+        function init() {
+            /* Search form initialization */
+            var form = document.forms['search'];
+            if (form != null) {
+                form.elements['domains'].value = location.hostname;
+                form.elements['sitesearch'].value = location.hostname;
+            }
+
+            /* Children initialization */
+            hide = document.getElementById('hide');
+            show = document.getElementById('show');
+            children = document.all != null ?
+                    document.all['children'] :
+                    document.getElementById('children');
+            if (children != null) {
+                children.style.display = 'none';
+                show.style.display = 'inline';
+                hide.style.display = 'none';
+            }
+        }
+
+        function showChildren() {
+            children.style.display = 'block';
+            show.style.display = 'none';
+            hide.style.display = 'inline';
+        }
+
+        function hideChildren() {
+            children.style.display = 'none';
+            show.style.display = 'inline';
+            hide.style.display = 'none';
+        }
+    </script>
+    <title>Conversion Annotation</title>
+</head>
+<body onload="init()">
+<table border="0" cellpadding="2" cellspacing="0" width="100%">
+    <tr class="topBar">
+        <td align="left" valign="middle" class="topBarDiv" align="left" nowrap>
+            &nbsp;<a href="home.html">Home</a>&nbsp;&gt;&nbsp;<a 
href="guides.html">Guides</a>&nbsp;&gt;&nbsp;<a 
href="core-developers-guide.html">Core Developers Guide</a>&nbsp;&gt;&nbsp;<a 
href="annotations.html">Annotations</a>&nbsp;&gt;&nbsp;<a 
href="conversion-annotation.html">Conversion Annotation</a>
+        </td>
+        <td align="right" valign="middle" nowrap>
+            <form name="search" action="https://www.google.com/search"; 
method="get">
+                <input type="hidden" name="ie" value="UTF-8" />
+                <input type="hidden" name="oe" value="UTF-8" />
+                <input type="hidden" name="domains" value="" />
+                <input type="hidden" name="sitesearch" value="" />
+                <input type="text" name="q" maxlength="255" value="" />
+                <input type="submit" name="btnG" value="Google Search" />
+            </form>
+        </td>
+    </tr>
+</table>
+
+<div id="PageContent">
+    <div class="pageheader" style="padding: 6px 0px 0px 0px;">
+        <!-- We'll enable this once we figure out how to access (and save) the 
logo resource -->
+        <!--img src="/wiki/images/confluence_logo.gif" style="float: left; 
margin: 4px 4px 4px 10px;" border="0"-->
+        <div style="margin: 0px 10px 0px 10px" class="smalltext">Apache Struts 
2 Documentation</div>
+        <div style="margin: 0px 10px 8px 10px"  class="pagetitle">Conversion 
Annotation</div>
+
+        <div class="greynavbar" align="right" style="padding: 2px 10px; 
margin: 0px;">
+            <a 
href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=14180";>
+                <img 
src="https://cwiki.apache.org/confluence/images/icons/notep_16.gif";
+                     height="16" width="16" border="0" align="absmiddle" 
title="Edit Page"></a>
+            <a 
href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=14180";>Edit
 Page</a>
+            &nbsp;
+            <a 
href="https://cwiki.apache.org/confluence/pages/listpages.action?key=WW";>
+                <img 
src="https://cwiki.apache.org/confluence/images/icons/browse_space.gif";
+                     height="16" width="16" border="0" align="absmiddle" 
title="Browse Space"></a>
+            <a 
href="https://cwiki.apache.org/confluence/pages/listpages.action?key=WW";>Browse 
Space</a>
+            &nbsp;
+            <a 
href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=WW&fromPageId=14180";>
+                <img 
src="https://cwiki.apache.org/confluence/images/icons/add_page_16.gif";
+                     height="16" width="16" border="0" align="absmiddle" 
title="Add Page"></a>
+            <a 
href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=WW&fromPageId=14180";>Add
 Page</a>
+            &nbsp;
+            <a 
href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=WW&fromPageId=14180";>
+                <img 
src="https://cwiki.apache.org/confluence/images/icons/add_blogentry_16.gif";
+                     height="16" width="16" border="0" align="absmiddle" 
title="Add News"></a>
+            <a 
href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=WW&fromPageId=14180";>Add
 News</a>
+        </div>
+    </div>
+
+    <div class="pagecontent">
+        <div class="wiki-content">
+            <div id="ConfluenceContent"><p>A marker annotation for type 
conversions at Type level.</p>
+
+<h2 id="ConversionAnnotation-Usage">Usage</h2>
+
+<p>The Conversion annotation must be applied at Type level.</p>
+
+<h2 id="ConversionAnnotation-Parameters">Parameters</h2>
+
+<p><table summary=""><thead><tr><th colspan="1" rowspan="1">Parameter</th><th 
colspan="1" rowspan="1">Required</th><th colspan="1" 
rowspan="1">Default</th><th colspan="1" 
rowspan="1">Description</th></tr></thead><tbody><tr><td colspan="1" 
rowspan="1">conversion</td><td colspan="1" rowspan="1">no</td><td colspan="1" 
rowspan="1">&#160;</td><td colspan="1" rowspan="1">used for Type Conversions 
applied at Type level.</td></tr></tbody></table></p>
+
+<h2 id="ConversionAnnotation-Examples">Examples</h2>
+
+<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[
+@Conversion(
+    conversions = {
+         // key must be the name of a property for which converter should be 
used
+         @TypeConversion(key = &quot;date&quot;, converter = 
&quot;org.demo.converter.DateConverter&quot;)
+    }
+)
+public class ConversionAction implements Action {
+
+    private Date date;
+
+    public setDate(Date date) {
+        this.date = date;
+    }
+
+    public Date getDate() {
+        return date;
+    }
+
+}
+
+]]></script>
+</div></div>
+
+<p>Check also <a shape="rect" 
href="typeconversion-annotation.html">TypeConversion Annotation</a> for more 
examples!</p></div>
+        </div>
+
+        
+    </div>
+</div>
+<div class="footer">
+    Generated by CXF SiteExporter
+</div>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/struts-site/blob/124e36c4/content/docs/conversion-error-interceptor.html
----------------------------------------------------------------------
diff --git a/content/docs/conversion-error-interceptor.html 
b/content/docs/conversion-error-interceptor.html
new file mode 100644
index 0000000..2675c9e
--- /dev/null
+++ b/content/docs/conversion-error-interceptor.html
@@ -0,0 +1,204 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
+<!-- 
+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. 
+-->
+<html>
+<head>
+    <link type="text/css" rel="stylesheet" 
href="https://struts.apache.org/css/default.css";>
+    <style type="text/css">
+        .dp-highlighter {
+            width:95% !important;
+        }
+    </style>
+    <style type="text/css">
+        .footer {
+            background-image:      
url('https://cwiki.apache.org/confluence/images/border/border_bottom.gif');
+            background-repeat:     repeat-x;
+            background-position:   left top;
+            padding-top:           4px;
+            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;
+        var children = null;
+
+        function init() {
+            /* Search form initialization */
+            var form = document.forms['search'];
+            if (form != null) {
+                form.elements['domains'].value = location.hostname;
+                form.elements['sitesearch'].value = location.hostname;
+            }
+
+            /* Children initialization */
+            hide = document.getElementById('hide');
+            show = document.getElementById('show');
+            children = document.all != null ?
+                    document.all['children'] :
+                    document.getElementById('children');
+            if (children != null) {
+                children.style.display = 'none';
+                show.style.display = 'inline';
+                hide.style.display = 'none';
+            }
+        }
+
+        function showChildren() {
+            children.style.display = 'block';
+            show.style.display = 'none';
+            hide.style.display = 'inline';
+        }
+
+        function hideChildren() {
+            children.style.display = 'none';
+            show.style.display = 'inline';
+            hide.style.display = 'none';
+        }
+    </script>
+    <title>Conversion Error Interceptor</title>
+</head>
+<body onload="init()">
+<table border="0" cellpadding="2" cellspacing="0" width="100%">
+    <tr class="topBar">
+        <td align="left" valign="middle" class="topBarDiv" align="left" nowrap>
+            &nbsp;<a href="home.html">Home</a>&nbsp;&gt;&nbsp;<a 
href="guides.html">Guides</a>&nbsp;&gt;&nbsp;<a 
href="core-developers-guide.html">Core Developers Guide</a>&nbsp;&gt;&nbsp;<a 
href="interceptors.html">Interceptors</a>&nbsp;&gt;&nbsp;<a 
href="conversion-error-interceptor.html">Conversion Error Interceptor</a>
+        </td>
+        <td align="right" valign="middle" nowrap>
+            <form name="search" action="https://www.google.com/search"; 
method="get">
+                <input type="hidden" name="ie" value="UTF-8" />
+                <input type="hidden" name="oe" value="UTF-8" />
+                <input type="hidden" name="domains" value="" />
+                <input type="hidden" name="sitesearch" value="" />
+                <input type="text" name="q" maxlength="255" value="" />
+                <input type="submit" name="btnG" value="Google Search" />
+            </form>
+        </td>
+    </tr>
+</table>
+
+<div id="PageContent">
+    <div class="pageheader" style="padding: 6px 0px 0px 0px;">
+        <!-- We'll enable this once we figure out how to access (and save) the 
logo resource -->
+        <!--img src="/wiki/images/confluence_logo.gif" style="float: left; 
margin: 4px 4px 4px 10px;" border="0"-->
+        <div style="margin: 0px 10px 0px 10px" class="smalltext">Apache Struts 
2 Documentation</div>
+        <div style="margin: 0px 10px 8px 10px"  class="pagetitle">Conversion 
Error Interceptor</div>
+
+        <div class="greynavbar" align="right" style="padding: 2px 10px; 
margin: 0px;">
+            <a 
href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=14116";>
+                <img 
src="https://cwiki.apache.org/confluence/images/icons/notep_16.gif";
+                     height="16" width="16" border="0" align="absmiddle" 
title="Edit Page"></a>
+            <a 
href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=14116";>Edit
 Page</a>
+            &nbsp;
+            <a 
href="https://cwiki.apache.org/confluence/pages/listpages.action?key=WW";>
+                <img 
src="https://cwiki.apache.org/confluence/images/icons/browse_space.gif";
+                     height="16" width="16" border="0" align="absmiddle" 
title="Browse Space"></a>
+            <a 
href="https://cwiki.apache.org/confluence/pages/listpages.action?key=WW";>Browse 
Space</a>
+            &nbsp;
+            <a 
href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=WW&fromPageId=14116";>
+                <img 
src="https://cwiki.apache.org/confluence/images/icons/add_page_16.gif";
+                     height="16" width="16" border="0" align="absmiddle" 
title="Add Page"></a>
+            <a 
href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=WW&fromPageId=14116";>Add
 Page</a>
+            &nbsp;
+            <a 
href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=WW&fromPageId=14116";>
+                <img 
src="https://cwiki.apache.org/confluence/images/icons/add_blogentry_16.gif";
+                     height="16" width="16" border="0" align="absmiddle" 
title="Add News"></a>
+            <a 
href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=WW&fromPageId=14116";>Add
 News</a>
+        </div>
+    </div>
+
+    <div class="pagecontent">
+        <div class="wiki-content">
+            <div id="ConfluenceContent"><p>The Struts 2 conversion error 
interceptor is a subclass of the XWork 2 conversion error interceptor.</p>
+
+<p>From the Javadocs of the XWork 2 interceptor:</p>
+
+<p>ConversionErrorInterceptor adds conversion errors from the ActionContext to 
the Action's field errors.</p>
+
+<p></p><p>
+This interceptor adds any error found in the ActionContext's conversionErrors 
map as a field error (provided
+that the action implements ValidationAware). In addition, any field that 
contains a validation error has its
+original value saved such that any subsequent requests for that value return 
the original value rather than the value
+in the action. This is important because if the value "abc" is submitted and 
can't be converted to an int, we want to
+display the original string ("abc") again rather than the int value (likely 0, 
which would make very little sense to
+the user).
+</p>
+
+<p></p><p>
+<b>Note:</b> Since 2.5.2, this interceptor extends MethodFilterInterceptor, 
therefore being
+able to deal with excludeMethods / includeMethods parameters. See [Workflow 
Interceptor]
+(class DefaultWorkflowInterceptor) for documentation and examples on how to 
use this feature.
+</p>
+
+
+<p>From the Javadocs of the Struts 2 interceptor:</p>
+
+<p></p><p>
+This interceptor extends ConversionErrorInterceptor but only adds conversion 
errors from the ActionContext to
+the field errors of the action if the field value is not null, "", or {""} (a 
size 1 String array with only an empty
+String). See ConversionErrorInterceptor for more information, as well as the 
Type Conversion documentation.
+</p>
+
+<h2 id="ConversionErrorInterceptor-Parameters">Parameters</h2>
+
+
+<p></p><ul></ul><p></p><ul><li>None</li></ul><p></p>
+
+
+<h2 id="ConversionErrorInterceptor-ExtendingtheInterceptor">Extending the 
Interceptor</h2>
+
+<p></p><p>
+There are no known extension points for this interceptor.
+</p>
+
+<h2 id="ConversionErrorInterceptor-Examples">Examples</h2>
+
+<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[
+&lt;action name=&quot;someAction&quot; 
class=&quot;com.examples.SomeAction&quot;&gt;
+    &lt;interceptor-ref name=&quot;params&quot;/&gt;
+    &lt;interceptor-ref name=&quot;conversionError&quot;/&gt;
+    &lt;result name=&quot;success&quot;&gt;good_result.ftl&lt;/result&gt;
+&lt;/action&gt;
+]]></script>
+</div></div></div>
+        </div>
+
+        
+    </div>
+</div>
+<div class="footer">
+    Generated by CXF SiteExporter
+</div>
+</body>
+</html>

Reply via email to