You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2013/07/17 11:31:13 UTC

svn commit: r869821 [4/43] - in /websites/production/struts/content/development/2.x/docs: ./ ajax-validation.data/ big-picture.data/ chaining-interceptor.data/ colophon.data/ config-browser-plugin.data/ create-struts-2-web-application-using-maven-to-ma...

Added: websites/production/struts/content/development/2.x/docs/building-with-maven.html
==============================================================================
--- websites/production/struts/content/development/2.x/docs/building-with-maven.html (added)
+++ websites/production/struts/content/development/2.x/docs/building-with-maven.html Wed Jul 17 09:31:08 2013
@@ -0,0 +1,420 @@
+<!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='http://struts.apache.org/highlighter/style/shCoreStruts.css' rel='stylesheet' type='text/css' />
+    <link href='http://struts.apache.org/highlighter/style/shThemeStruts.css' rel='stylesheet' type='text/css' />
+    <script src='http://struts.apache.org/highlighter/js/shCore.js' type='text/javascript'></script>
+            <script src='http://struts.apache.org/highlighter/js/shBrushJava.js' type='text/javascript'></script>
+            <script src='http://struts.apache.org/highlighter/js/shBrushXml.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>Building with Maven</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="contributors-guide.html">Contributors Guide</a>&nbsp;&gt;&nbsp;<a href="building-the-framework-from-source.html">Building the Framework from Source</a>&nbsp;&gt;&nbsp;<a href="building-with-maven.html">Building with Maven</a>
+        </td>
+        <td align="right" valign="middle" nowrap>
+            <form name="search" action="http://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">Building with Maven</div>
+
+        <div class="greynavbar" align="right" style="padding: 2px 10px; margin: 0px;">
+            <a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=14147">
+                <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=14147">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=14147">
+                <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=14147">Add Page</a>
+            &nbsp;
+            <a href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=WW&fromPageId=14147">
+                <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=14147">Add News</a>
+        </div>
+    </div>
+
+    <div class="pagecontent">
+        <div class="wiki-content">
+            <div id="ConfluenceContent"><div class="panelMacro"><table class="infoMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/information.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><a shape="rect" class="external-link" href="http://maven.apache.org">Maven 3.0.0 or later</a> is required to build Struts 2</td></tr></table></div>
+<p>First, let's review some Maven basics. Maven uses the notion of a build <em>life-cycle</em> to which plugins can attach. Plugins are similar to Ant tasks. When a Maven build is invoked, we specify a point in the life-cycle up to which the build <em>should</em> proceed. The <em>compile</em> phase comes before <em>test</em>, and <em>test</em> comes before <em>package</em>, and <em>package</em> comes before <em>install</em>. Once we have Maven setup, we can invoke the Struts build, and specify which phase the build should use.</p>
+
+<h2><a shape="rect" name="BuildingwithMaven-Installing"></a>Installing</h2>
+
+<p>The <em>install</em> phase builds up the project ("package"), and installs any JARs it needs into your local repository (e.g. <tt>~/.m2/repository</tt>). Once installed, the JARs can be used by any other Maven project you build.&#160; The <em>install</em> phase is the <b>default</b> phase if none is specified.</p>
+
+<p>To run a basic install, change to the root of the source distribution, and enter</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Go!</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+&gt; mvn
+]]></script>
+</div></div>
+<p>That's it! Maven will download any dependencies the build needs; run all unit tests; package up the JARs; then install the new JARs locally. For your convenience, copies of the JARs can be found in the <em>target</em> directories of each module. For example, after the build, the main JAR can found at <tt>core/target/struts2-core-2.0-SNAPSHOT.jar</tt>.</p>
+<div class="panelMacro"><table class="warningMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/forbidden.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>It's supposed to be automatic, but you might still have to press the button</b><br clear="none">Sometimes, licensing restrictions prevent Maven from downloading all the JARs that a build might need. For example, JavaMail and Activation, can only be downloaded from Sun. When this happens, Maven will display a helpful message that explains how to install these JARs manually. After downloading the required JAR, follow the instructions to install it to the your local repository. Once installed, the JAR is available to all your Maven builds, not just Struts.</td></tr></table></div>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Initial Build Successful</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+[INFO] ------------------------------------------------------------------------
+[INFO] Reactor Summary:
+[INFO] ------------------------------------------------------------------------
+[INFO] Struts 2 .............................................. SUCCESS [0.870s]
+[INFO] Struts 2 - Core ....................................... SUCCESS [1:17.272s]
+[INFO] Struts 2 API .......................................... SUCCESS [3.252s]
+[INFO] ------------------------------------------------------------------------
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 1 minute 22 seconds
+[INFO] Finished at: Wed Jul 19 10:46:01 PDT 2006
+[INFO] Final Memory: 10M/42M
+[INFO] ------------------------------------------------------------------------
+]]></script>
+</div></div>
+
+<h3><a shape="rect" name="BuildingwithMaven-Otherphases"></a>Other phases</h3>
+
+<p>There are other phases that can be useful when working with Maven. The <em>package</em> phase will just JAR (or WAR) the modules. The <em>test</em> phase will only execute unit-tests. The <em>compile</em> phase will only build the source-code (but not the test sources). And the <em>clean</em> phase will remove all artifacts, typically the entire <em>target</em> directory.</p>
+
+<h2><a shape="rect" name="BuildingwithMaven-Buildprofiles"></a>Build profiles</h2>
+
+<p>The next step in building the framework with Maven is to understand <em>build profiles</em>. Profiles provide  different configurations for a build. There are several profiles, including <em>default</em>, <em>xwork</em>, and _thirdparty".</p>
+<div class="table-wrap">
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Profile </th><th colspan="1" rowspan="1" class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> default </td><td colspan="1" rowspan="1" class="confluenceTd"> Builds site, api, and core </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> apps </td><td colspan="1" rowspan="1" class="confluenceTd"> Builds the example applications </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> plugins </td><td colspan="1" rowspan="1" class="confluenceTd"> Builds all plugins </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> extras </td><td colspan="1" rowspan="1" class="confluenceTd"> Includes the extras module that cannot be part of the default build due to licensing incompatibilities </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> xwork </td><td colspan="1" rowspan="1" class="confluenceTd"> Includes the xwork b
 uild </td></tr></tbody></table>
+</div>
+
+<p>The default profile will work for most developers; however some developers will want to use additional profiles because they work on both XWork and other modules, such as the JasperReports integration.</p>
+
+<p>Specifying a profile is easy:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Profile, please</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+&gt; mvn -Pprofile ...
+]]></script>
+</div></div>
+
+<h2><a shape="rect" name="BuildingwithMaven-ExtrasProfile"></a>Extras Profile</h2>
+
+<p>If you want to build all the <em>Extras</em> module (not included in the default build) use the _extras*_profile.</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Extras Module</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+&gt; mvn -Pextras
+]]></script>
+</div></div>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Build with Third Party Modules</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+[INFO] ------------------------------------------------------------------------
+[INFO] Reactor Summary:
+[INFO] ------------------------------------------------------------------------
+[INFO] Struts 2 .............................................. SUCCESS [1.047s]
+[INFO] Struts 2 - Core ....................................... SUCCESS [33.615s]
+[INFO] Struts 2 API .......................................... SUCCESS [0.520s]
+[INFO] Struts Extras ......................................... SUCCESS [20.944s]
+[INFO] ------------------------------------------------------------------------
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 57 seconds
+[INFO] Finished at: Wed Jul 19 10:51:05 PDT 2006
+[INFO] Final Memory: 9M/40M
+[INFO] ------------------------------------------------------------------------
+]]></script>
+</div></div>
+<p>In the second run, the Extras module is built. If you decide to make use of this module, be sure to review the licenses of its dependencies, since they may fall under a license that is incompatible with the Apache License.</p>
+
+<h2><a shape="rect" name="BuildingwithMaven-XWorkprofile"></a>XWork profile</h2>
+
+<p>Struts 2 is an extension of the XWork framework. While Struts2 adds a lot of value for web developers, much of the core functionality is derived from XWork. The <em>xwork</em> plugins add the capability to build against a current XWork check-out, rather than a pre-compiled JAR.</p>
+
+<p>The plugin assumes that the latest XWork code is checked out and is located at <tt>../xwork</tt>, relative to the struts2 folder. You can check out XWork using the Subversion command:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Checking out XWork</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+svn co https://svn.opensymphony.com/svn/xwork/trunk xwork
+]]></script>
+</div></div>
+<div class="panelMacro"><table class="tipMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/check.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Subversion</b><br clear="none">If you don't have the command line version of Subversion installed, you can <a shape="rect" class="external-link" href="http://subversion.tigris.org/project_packages.html" rel="nofollow">download it from the Subversion site</a>, and add the <tt>bin</tt> folder to your command path.</td></tr></table></div>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Working XWork</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+&gt; mvn -Pxwork package
+]]></script>
+</div></div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+[INFO] ------------------------------------------------------------------------
+[INFO] Reactor Summary:
+[INFO] ------------------------------------------------------------------------
+[INFO] XWork ................................................. SUCCESS [39.527s]
+[INFO] Struts 2 .............................................. SUCCESS [0.216s]
+[INFO] Struts 2 - Core ....................................... SUCCESS [29.736s]
+[INFO] Struts 2 API .......................................... SUCCESS [0.318s]
+[INFO] ------------------------------------------------------------------------
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 1 minute 11 seconds
+[INFO] Finished at: Wed Jul 19 10:57:27 PDT 2006
+[INFO] Final Memory: 12M/53M
+[INFO] ------------------------------------------------------------------------
+]]></script>
+</div></div>
+<p>Now, Maven will build XWork from source and use that as the XWork snapshot for the Struts build.</p>
+
+<h2><a shape="rect" name="BuildingwithMaven-Multipleprofiles"></a>Multiple profiles</h2>
+
+<p>Maven can build against multiple profiles. If you are developing against both the XWork and Struts 2 frameworks at once, you can install both profiles with one call to Maven.</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Getting it All</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+&gt; mvn -Pextras,plugins,xwork
+]]></script>
+</div></div>
+<p>Using both profiles is especially important when using Maven to build your IDE project files (recommended).</p>
+
+<h2><a shape="rect" name="BuildingwithMaven-BuildingIDEprojectfiles"></a>Building IDE project files</h2>
+
+<p>Maven has a great feature that will allow you to build up your IDEA or Eclipse project files based on the project build structure. Using the Maven project files helps keep developers in-sync and efficient. The IDEA project files are pre-configured to define in the Run/Debug menu many common tasks, such as "execute all tests", "launch the showcase sample app", and so fort.</p>
+
+<h3><a shape="rect" name="BuildingwithMaven-IDEAbyJetBrains"></a>IDEA by JetBrains</h3>
+
+<p>The Maven IDEA plugin creates IDEA project and modules files, based on the Maven build configuraton (pom.xml).</p>
+
+<p>First, be sure you have the latest IDEA plugin for Maven.</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Get the latest plugin!</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+mvn -DconnectionUrl=scm:svn:http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-idea-plugin \
+    -Dgoals=install \
+    scm:bootstrap
+]]></script>
+</div></div>
+<p>Most often, we use Maven to build projects, but it can also run plugins directly. To build an IDEA project file for Struts 2, including all the modules, run</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Generate the project files</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+&gt; mvn idea:idea -Papps,extras,thirdparty,xwork
+]]></script>
+</div></div>
+<p>Maven will generate <em>struts-parent.ipr</em>, <em>struts-parent.iws</em>, and an <em>iml</em> file for each module listed Open up <em>struts-parent.ipr</em> in IDEA, and you should be good to go.</p>
+
+<p>If you ever need to rebuild your projects, running the <tt>idea:idea</tt> command again will update your files without overriding any information that doesn't conflict. If you do want to overwrite the project files, specify the overwrite parameter as true.</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Starting over</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+&gt; mvn idea:idea -Doverwrite=true -Papps,extras,thirdparty,plugins,xwork
+
+If you only need to rebuild some of the modules, adjust the list of "profiles".
+]]></script>
+</div></div>
+<div class="panelMacro"><table class="tipMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/check.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Clearing the cache</b><br clear="none">If you find the xwork module causing you problems, such as displaying as "XWork" when it should be named "xwork", the problem is likely to be within IDEA. Try clearing out your IDEA system cache and then run it again</td></tr></table></div>
+
+<h2><a shape="rect" name="BuildingwithMaven-Eclipse"></a>Eclipse</h2>
+
+<p>For Eclipse, try</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Generating Eclipse</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+&gt; mvn -Pthirdparty,plugins,xwork eclipse:eclipse
+]]></script>
+</div></div>
+<div class="panelMacro"><table class="infoMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/information.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Feedback Wanted</b><br clear="none">Many Struts 2 developers use IDEA, and the Eclipse project files are not as well-tested or featureful as the IDEA versions. But as far as we know, they work!</td></tr></table></div>
+
+<h2><a shape="rect" name="BuildingwithMaven-IMPORTANT%3ARunningtheSampleApplicationsfromEclipseornonIDEAIDEs"></a>IMPORTANT: Running the Sample Applications from Eclipse or non-IDEA IDEs</h2>
+
+<p>Currently the sample applications can be deployed using the <a shape="rect" class="external-link" href="http://www.mortbay.org/maven-plugin/index.html" rel="nofollow">Maven 2 Jetty plugin</a>.  For example, you can run the showcase example application from the command line:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Runnning Showcase in Linux</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+cd apps/showcase
+mvn jetty:run
+]]></script>
+</div></div>
+<p>You could also use one of the Maven IDE plugins to run the plugin or simply execute the <tt>mvn</tt> or <tt>mvn.bat</tt> file as an external application within your IDE.<br clear="none">
+A good tutorial on how to use the Maven 2 jetty plugin along with your IDE, including JPDA debugging support, can be found at the <a shape="rect" class="external-link" href="http://cwiki.apache.org/WICKET/maven-jetty-plugin.html">Apache Wicket documentation</a>.</p>
+
+<h2><a shape="rect" name="BuildingwithMaven-MavenTips"></a>Maven Tips</h2>
+
+<p>A few helpful tips for using Maven are provided:</p>
+
+<h3><a shape="rect" name="BuildingwithMaven-Offlinemode"></a>Offline mode</h3>
+
+<p>If you are disconnected from the Internet or simply wish to make your build faster, pass in the <b>-o</b> argument and Maven won't check for new modules to download.</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Offline Mode</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+mvn -o -Pextras,plugins,xwork
+]]></script>
+</div></div>
+
+<h3><a shape="rect" name="BuildingwithMaven-OutOfMemoryError"></a>OutOfMemoryError</h3>
+
+<p>If you get an OutOfMemoryError while running the tests:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Memory Settings</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+// Bash
+export MAVEN_OPTS=-Xmx512m
+
+// Windows
+set MAVEN_OPTS=-Xmx512m
+]]></script>
+</div></div>
+
+<h3><a shape="rect" name="BuildingwithMaven-Skippingtestexecution"></a>Skipping test execution</h3>
+
+<p>Although this shouldn't ever happen, sometimes tests do fail and you need to build the framework anyway. If there's a problem, you can pass in the skip tests parameter.</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Skip Tests</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+mvn -Dmaven.test.skip=true -Pextras,plugins,xwork
+]]></script>
+</div></div>
+<p>Of course, if you find tests are failing, please submit a patch to fix them!</p>
+
+<h3><a shape="rect" name="BuildingwithMaven-Debuggingbuildfailures"></a>Debugging build failures</h3>
+
+<p>Struts 2 depends on the current snapshot artifact of XWork 2.  Unfortunately, if XWork 2 is modified in a significant way, the Struts build doesn't check for and retrieve a new version of the XWork snapshot jar, resulting in compilation or unit test failures.</p>
+
+<p>The solution is to clear out any stale XWork 2 jars in your local Maven repository, usually by removing the directory <tt>~/.m2/repository/opensymphony</tt>.  This will force the Struts Maven build to pull down a fresh copy of XWork and hopefully resolve your problem.</p>
+
+<h2><a shape="rect" name="BuildingwithMaven-Creatingarelease"></a>Creating a release</h2>
+
+<p>Maven terms a release build an "assembly". An assembly aggregates the builds of all the modules installed locally on your machine into one or more release files. The default profile for building Struts 2 includes an assembly that attempts to download a mirror of the wiki. This can be time-consuming, to disable the assembly module just add -DskipAssembly to your maven command line.</p>
+
+<p>To create a release, you must first build and install locally every artifact.  From the root <tt>struts2</tt> directory, run:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Building all modules</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+mvn -Pextras,apps,plugins install
+]]></script>
+</div></div>
+<p>Next, you need to run the assembly build to create the release files.  From the <tt>struts2/assembly</tt> directory, run:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Building the assembly</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+mvn assembly:assembly
+]]></script>
+</div></div>
+<p>If the assembly built correctly, you should see the release files in the <tt>target/assembly/out</tt> directory.</p>
+
+<h2><a shape="rect" name="BuildingwithMaven-Mirrors"></a>Mirrors</h2>
+
+<p>The default mirror for Maven builds ("ibiblio") can be slow and unreliable. Maven lets you specify <a shape="rect" class="external-link" href="http://maven.apache.org/guides/mini/guide-mirror-settings.html">alternative mirrors</a> so that you don't have to depend on ibiblio for everything.</p>
+
+<p>You can add new mirrors through the Settings file (~/.m2/settings.xml).</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Mirror, Mirror</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;settings&gt;
+
+  &lt;mirrors&gt;
+    &lt;mirror&gt;
+      &lt;id&gt;dotsrc&lt;/id&gt;
+      &lt;url&gt;http://mirrors.dotsrc.org/maven2&lt;/url&gt;
+      &lt;mirrorOf&gt;central&lt;/mirrorOf&gt;
+    &lt;/mirror&gt;
+  &lt;/mirrors&gt;
+
+&lt;/settings&gt;
+]]></script>
+</div></div>
+<div class="panelMacro"><table class="tipMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/check.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1">Sometimes the alternative mirrors have problems too or aren't updated at the same frequency as the main mirror. If you have trouble building, try commenting out the aternative mirror.</td></tr></table></div>
+
+<h2><a shape="rect" name="BuildingwithMaven-Firsttimebuilding"></a>First time building</h2>
+
+<p>In some cases it has been seen that Maven will complain if a module doesn't exist, even though it is part of the current build. Often, the missing module turns up when executing <tt>mvn package</tt>. A simple fix for this is to run <tt>mvn install</tt> instead. If you have to do this, it will probably only be a one time thing.</p>
+
+<h3><a shape="rect" name="BuildingwithMaven-Next%3ACreatingandSigningaDistribution"></a>Next: <a shape="rect" href="creating-and-signing-a-distribution.html" title="Creating and Signing a Distribution">Creating and Signing a Distribution</a></h3></div>
+        </div>
+
+        
+    </div>
+</div>
+<div class="footer">
+    Generated by CXF SiteExporter
+</div>
+</body>
+</html>
\ No newline at end of file

Added: websites/production/struts/content/development/2.x/docs/can-an-action-tag-run-another-method-apart-from-the-default-execute-method.html
==============================================================================
--- websites/production/struts/content/development/2.x/docs/can-an-action-tag-run-another-method-apart-from-the-default-execute-method.html (added)
+++ websites/production/struts/content/development/2.x/docs/can-an-action-tag-run-another-method-apart-from-the-default-execute-method.html Wed Jul 17 09:31:08 2013
@@ -0,0 +1,153 @@
+<!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='http://struts.apache.org/highlighter/style/shCoreStruts.css' rel='stylesheet' type='text/css' />
+    <link href='http://struts.apache.org/highlighter/style/shThemeStruts.css' rel='stylesheet' type='text/css' />
+    <script src='http://struts.apache.org/highlighter/js/shCore.js' type='text/javascript'></script>
+            <script src='http://struts.apache.org/highlighter/js/shBrushJava.js' type='text/javascript'></script>
+            <script src='http://struts.apache.org/highlighter/js/shBrushXml.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>Can an action tag run another method apart from the default execute method</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="faqs.html">FAQs</a>&nbsp;&gt;&nbsp;<a href="can-an-action-tag-run-another-method-apart-from-the-default-execute-method.html">Can an action tag run another method apart from the default execute method</a>
+        </td>
+        <td align="right" valign="middle" nowrap>
+            <form name="search" action="http://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">Can an action tag run another method apart from the default execute method</div>
+
+        <div class="greynavbar" align="right" style="padding: 2px 10px; margin: 0px;">
+            <a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=14075">
+                <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=14075">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=14075">
+                <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=14075">Add Page</a>
+            &nbsp;
+            <a href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=WW&fromPageId=14075">
+                <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=14075">Add News</a>
+        </div>
+    </div>
+
+    <div class="pagecontent">
+        <div class="wiki-content">
+            <div id="ConfluenceContent"><p>Using the "bang" syntax, any alias method on an Action can be called from the <tt>action</tt>, <tt>submit</tt>, or <tt>button</tt> tags.</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;s:action name="action!alias" .... /&gt;
+]]></script>
+</div></div></div>
+        </div>
+
+        
+    </div>
+</div>
+<div class="footer">
+    Generated by CXF SiteExporter
+</div>
+</body>
+</html>
\ No newline at end of file

Added: websites/production/struts/content/development/2.x/docs/can-you-suggest-an-elevator-pitch.html
==============================================================================
--- websites/production/struts/content/development/2.x/docs/can-you-suggest-an-elevator-pitch.html (added)
+++ websites/production/struts/content/development/2.x/docs/can-you-suggest-an-elevator-pitch.html Wed Jul 17 09:31:08 2013
@@ -0,0 +1,169 @@
+<!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>
+    <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>Can you suggest an elevator pitch</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="faqs.html">FAQs</a>&nbsp;&gt;&nbsp;<a href="can-you-suggest-an-elevator-pitch.html">Can you suggest an elevator pitch</a>
+        </td>
+        <td align="right" valign="middle" nowrap>
+            <form name="search" action="http://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">Can you suggest an elevator pitch</div>
+
+        <div class="greynavbar" align="right" style="padding: 2px 10px; margin: 0px;">
+            <a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=14012">
+                <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=14012">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=14012">
+                <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=14012">Add Page</a>
+            &nbsp;
+            <a href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=WW&fromPageId=14012">
+                <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=14012">Add News</a>
+        </div>
+    </div>
+
+    <div class="pagecontent">
+        <div class="wiki-content">
+            <div id="ConfluenceContent">
+<p>Here's the Who, What, When, Where, and Why of Struts 2.</p>
+
+<h3><a shape="rect" name="Canyousuggestanelevatorpitch-Whoshouldusetheframework%3F"></a>Who should use the framework?</h3>
+
+<p>Struts 2 is designed to help Java web developers create enterprise-class applications using accepted industry standards and design patterns. </p>
+
+<h3><a shape="rect" name="Canyousuggestanelevatorpitch-Whatdoestheframeworkdo%3F"></a>What does the framework do? </h3>
+
+<p>The framework provides a flexible front controller and a set of custom tags. The controller's job is to map requests to actions.  This helps developers organize their business logic.  The Struts 2 tags help page authors create interactive pages. </p>
+
+<h3><a shape="rect" name="Canyousuggestanelevatorpitch-Howlonghavepeoplebeenusingtheframework%3F"></a>How long have people been using the framework? </h3>
+
+<p>The original Struts framework shipped in June 2001.  WebWork came out in March 2002 with the goal of improving Struts 1 and adopting the best ideas from other frameworks.  In December 2005, the WebWork and Struts communities joined forces to create the Struts 2 framework.  The initial release of Struts 2 is expected in the first quarter of 2007.</p>
+
+<h3><a shape="rect" name="Canyousuggestanelevatorpitch-Whereistheframeworkhosted%3F"></a>Where is the framework hosted? </h3>
+
+<p>Struts is a project of the Apache Software Foundation. The framework is made available to the public at no charge under the open source Apache License. The official Struts website is located at <a shape="rect" class="external-link" href="http://struts.apache.org">http://struts.apache.org</a>.</p>
+
+<p><img align="middle" class="emoticon" src="https://cwiki.apache.org/confluence/images/icons/emoticons/lightbulb_on.gif" height="16" width="16" alt="" border="0"> Visit the <a shape="rect" class="external-link" href="http://struts.apache.org/download.html">Struts download page</a> to obtain a distribution. </p>
+
+<h3><a shape="rect" name="Canyousuggestanelevatorpitch-Whyistheframeworkagoodchoiceformyapplication%3F"></a>Why is the framework a good choice for my application? </h3>
+
+<p><em>Reliability. Flexibility. Performance.</em> </p>
+
+<p><b>Reliability.</b> The Struts project has been serving the Java web development community since May 2000.  We have earned a reputation for shipping software that is long on features and short on defects. </p>
+
+<p><b>Flexibility.</b> The Struts 2 framework is designed to be pluggable from the ground up.  The controller's lifecycle can be customized for each application, and even for each action within an application.  The tag library is stylesheet-driven and easy to customize, either all at once or tag by tag.  Struts 2 does what you want it to do, but <em>only</em> what you want it to do. </p>
+
+<p><b>Performance.</b> From field experience, we know that Struts-like, action-oriented frameworks perform well and are maintainable. </p>
+
+</div>
+        </div>
+
+        
+    </div>
+</div>
+<div class="footer">
+    Generated by CXF SiteExporter
+</div>
+</body>
+</html>
\ No newline at end of file

Added: websites/production/struts/content/development/2.x/docs/cdi-plugin.html
==============================================================================
--- websites/production/struts/content/development/2.x/docs/cdi-plugin.html (added)
+++ websites/production/struts/content/development/2.x/docs/cdi-plugin.html Wed Jul 17 09:31:08 2013
@@ -0,0 +1,520 @@
+<!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='http://struts.apache.org/highlighter/style/shCoreStruts.css' rel='stylesheet' type='text/css' />
+    <link href='http://struts.apache.org/highlighter/style/shThemeStruts.css' rel='stylesheet' type='text/css' />
+    <script src='http://struts.apache.org/highlighter/js/shCore.js' type='text/javascript'></script>
+            <script src='http://struts.apache.org/highlighter/js/shBrushJava.js' type='text/javascript'></script>
+            <script src='http://struts.apache.org/highlighter/js/shBrushXml.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>CDI 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="cdi-plugin.html">CDI Plugin</a>
+        </td>
+        <td align="right" valign="middle" nowrap>
+            <form name="search" action="http://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">CDI Plugin</div>
+
+        <div class="greynavbar" align="right" style="padding: 2px 10px; margin: 0px;">
+            <a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=27842284">
+                <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=27842284">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=27842284">
+                <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=27842284">Add Page</a>
+            &nbsp;
+            <a href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=WW&fromPageId=27842284">
+                <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=27842284">Add News</a>
+        </div>
+    </div>
+
+    <div class="pagecontent">
+        <div class="wiki-content">
+            <div id="ConfluenceContent"><div>
+<ul><li><a shape="rect" href="#CDIPlugin-Overview">Overview</a></li><li><a shape="rect" href="#CDIPlugin-Setup">Setup</a></li><ul><li><a shape="rect" href="#CDIPlugin-MavenSetup">Maven Setup</a></li><li><a shape="rect" href="#CDIPlugin-ManualIntegration">Manual Integration</a></li><li><a shape="rect" href="#CDIPlugin-Configuration">Configuration</a></li></ul><li><a shape="rect" href="#CDIPlugin-Usage">Usage</a></li><ul><li><a shape="rect" href="#CDIPlugin-ExampleUsage">Example Usage</a></li></ul></ul></div>
+
+<h1><a shape="rect" name="CDIPlugin-Overview"></a>Overview</h1>
+
+<p>CDI - short for Contexts and Dependency Injection - is the new standard for Java EE (though not limited to it) dependency injection frameworks. It was introduced as <a shape="rect" class="external-link" href="http://jcp.org/en/jsr/summary?id=299" rel="nofollow">JSR 299</a>, being a part of the <a shape="rect" class="external-link" href="http://jcp.org/en/jsr/detail?id=316" rel="nofollow">Java EE 6</a> umbrella specification. It is also important to note that it builds on top of JSR 330 (Dependency Injection for Java SE), often referenced as <a shape="rect" class="external-link" href="http://jcp.org/en/jsr/summary?id=330" rel="nofollow">@Inject</a>.</p>
+
+<p>It can be used as standalone solution packed with your web applications to run in lightweight servlet containers such as Apache Tomcat or Jetty, utilizing standalone CDI implementations such as <a shape="rect" class="external-link" href="http://seamframework.org/Weld" rel="nofollow">JBoss Weld</a> (the JSR 299 reference implementation) or <a shape="rect" class="external-link" href="http://openwebbeans.apache.org/">Apache OpenWebBeans</a>. On the other hand, each JEE 6 compliant application server such as <a shape="rect" class="external-link" href="http://glassfish.java.net/" rel="nofollow">Glassfish</a>, <a shape="rect" class="external-link" href="http://www.jboss.org/jbossas" rel="nofollow">JBoss AS</a> or <a shape="rect" class="external-link" href="http://openejb.apache.org/apache-tomee.html">Apache TomEE</a> is required to have a CDI container on board, making it easy for developers to pack lightweight web or enterprise archives while being able to use a compelling dependency 
 injection feature set.</p>
+
+<p>With the Struts 2 CDI plugin, your application is open to be embedded into this modern, comprehensive and type safe framework and take full use of it.</p>
+
+<h1><a shape="rect" name="CDIPlugin-Setup"></a>Setup</h1>
+
+<p>As with all Struts 2 plugins, usage of the CDI plugin is as easy as delivering the right jars with your web application. The plugin then registers itself as the standard ObjectFactory for your Struts 2 application.</p>
+
+<div class="panelMacro"><table class="infoMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/information.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Don't mess up Object Factory Providers</b><br clear="none">Struts 2 delivers integration into all relevant dependency injection containers via plugins, such as the <a shape="rect" href="spring-plugin.html" title="Spring Plugin">Spring Plugin</a> or the externally provided <a shape="rect" class="external-link" href="http://code.google.com/p/google-guice/wiki/Struts2Integration" rel="nofollow">Guice Struts 2 Plugin</a>. Be aware that the central feature of all those, as well as the CDI plugin, is to register itself as Struts 2 Object factory. Usually you will want to use <b>exactly one of those plugins</b> in your application, since there will only b
 e <b>one ObjectFactory</b> implementation for Struts 2 to chose. If you pack more than one of those plugins, the factory to be chosen will be undetermined. One will win in the end, but who knows which ...</td></tr></table></div>
+
+<h2><a shape="rect" name="CDIPlugin-MavenSetup"></a>Maven Setup</h2>
+
+<p>The most easy and recommended way use is to simply add a maven dependency for it, along with a dependency to the CDI API for development time usage:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>pom.xml</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;dependencies&gt;
+    ...
+    &lt;dependency&gt;
+        &lt;groupId&gt;org.apache.struts&lt;/groupId&gt;
+        &lt;artifactId&gt;struts2-cdi-plugin&lt;/artifactId&gt;
+        &lt;version&gt;${struts2.version}&lt;/version&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+        &lt;groupId&gt;javax.enterprise&lt;/groupId&gt;
+        &lt;artifactId&gt;cdi-api&lt;/artifactId&gt;
+        &lt;version&gt;1.0-SP1&lt;/version&gt;
+        &lt;scope&gt;provided&lt;/scope&gt;
+    &lt;/dependency&gt;
+    ...
+&lt;/dependencies&gt;
+]]></script>
+</div></div>
+
+<p>whereas </p><div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[${struts2.version}]]></script>
+</div></div> should be set either as a property in your pom (recommended) or substituted by a concrete version information, such as 2.3.2 by the time of writing of this document. If you want to use CDI without an application server providing it, you may also want to add a dependency to a CDI implementation of your choice, for example Weld:
+
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>pom.xml with CDI implementation</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;dependencies&gt;
+    ...
+    &lt;dependency&gt;
+        &lt;groupId&gt;org.apache.struts&lt;/groupId&gt;
+        &lt;artifactId&gt;struts2-cdi-plugin&lt;/artifactId&gt;
+        &lt;version&gt;${struts2.version}&lt;/version&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+        &lt;groupId&gt;javax.enterprise&lt;/groupId&gt;
+        &lt;artifactId&gt;cdi-api&lt;/artifactId&gt;
+        &lt;version&gt;1.0-SP1&lt;/version&gt;
+        &lt;scope&gt;provided&lt;/scope&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+        &lt;groupId&gt;org.jboss.weld&lt;/groupId&gt;
+        &lt;artifactId&gt;weld-core&lt;/artifactId&gt;
+        &lt;version&gt;1.0.1-Final&lt;/version&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+        &lt;groupId&gt;org.jboss.weld&lt;/groupId&gt;
+        &lt;artifactId&gt;weld-se&lt;/artifactId&gt;
+        &lt;version&gt;1.0.1-Final&lt;/version&gt;
+    &lt;/dependency&gt;
+    ...
+&lt;/dependencies&gt;
+]]></script>
+</div></div>
+
+<h2><a shape="rect" name="CDIPlugin-ManualIntegration"></a>Manual Integration</h2>
+
+<p>Ensure that the struts2-cdi-plugin jar matching your used Struts 2 framework version - it is part of the <a shape="rect" class="external-link" href="http://struts.apache.org/download.cgi">Struts 2 distribution</a> - is packed within the application archive that will be delivered. If a CDI implementation is provided within your container, no other dependencies are needed. If the latter is not the case, you may want to install a CDI container into your container (as commmon installation or packed with your app) according to the installation instructions of the CDI provider of choice.</p>
+
+<p>For IDE integration, be sure to add both the struts2-cdi-plugin-VERSION.jar as well as the cdi-api.jar to your project setup. Remember, the API jar should not be delivered with your application archive since you will have the API provided by the CDI container your application will be running with.</p>
+
+<h2><a shape="rect" name="CDIPlugin-Configuration"></a>Configuration</h2>
+
+<p>Not much to see here. The CDI specification requires the CDI container to be exposed via JNDI context, and the CDI plugin will pick it up just there. Nevertheless, since there are different JNDI namespaces in use, the plugin will try to automatically find the right one among known references, that is</p>
+
+<ul><li>java:comp/BeanManager as the CDI docs point out</li><li>java:app/BeanManager as the Weld docs point out</li><li>java:comp/env/BeanManager for containers limited to that namespace, such as tomcat</li></ul>
+
+
+<p>If your container of choice uses other naming references, the plugin has a single configuration option to point to the right name. Just add a constant like this to your struts.xml to be on the happy path again:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>struts.xml</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+    &lt;constant name="struts.objectFactory.cdi.jndiKey" value="java:comp/some/weird/BeanManagerReference" /&gt;
+]]></script>
+</div></div>
+
+<h1><a shape="rect" name="CDIPlugin-Usage"></a>Usage</h1>
+
+<p>CDI has an extremely rich feature set, and this section is not intended as a replacement for the CDI reference documentation or the excellent documentation found on the <a shape="rect" class="external-link" href="http://seamframework.org/Weld" rel="nofollow">JBoss Weld</a> homepage. The whole Struts 2 CDI integration works just as you would think it works, using JSR-299 and JSR-330 Annotations in your Struts 2 actions or interceptors. Be aware of the following, though:</p>
+
+<div class="panelMacro"><table class="noteMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/warning.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Remember to provide beans.xml</b><br clear="none">CDI is designed to act in a type safe and modern way, thus using annotations for all aspects of the framework. Nevertheless, you are allowed to eternalize configuration into a XML file called beans.xml to be placed in your WEB-INF directory. Even if you don't intend to use such external configuration, it is an <b>inevitable requirement to provide at least an empty beans.xml in WEB-INF !</b></td></tr></table></div>
+
+<h2><a shape="rect" name="CDIPlugin-ExampleUsage"></a>Example Usage</h2>
+
+<p>Implement your Struts 2 actions or interceptors just as usual, enriched with CDI and @Inject annotations:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>NumberGuess.java</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+package org.apache.struts2.example.cdi;
+
+import com.opensymphony.xwork2.ActionSupport;
+import javax.inject.Inject;
+
+public class NumberGuess extends ActionSupport {
+
+    @Inject
+    Game game;
+
+    public Game getGame() {
+        return game;
+    }
+
+    @Override
+    public String execute() throws Exception {
+        return SUCCESS;
+    }
+
+    public String guess() throws Exception {
+        final String errorMessage = game.check();
+        addActionError(errorMessage);
+
+        if (Game.CORRECT.equals(errorMessage)) {
+            game.reset();
+        } else if (game.getRemainingGuesses() == 0) {
+            addActionError("The correct guess was " + game.getGuess() + ". Game is reset.");
+            game.reset();
+        }
+
+
+        return SUCCESS;
+    }
+
+
+}
+]]></script>
+</div></div>
+
+<p>See the @Inject annotation from javax.inject.Inject? While you could use all the other nice stuff, we usually would - following the separation of concerns principle - use @Inject most of the time only in our actions, keeping the more fancy stuff in the business layer as shown below. Using @Inject brings us to the most common pitfall when using Struts 2 together with JSR-330 / CDI:</p>
+
+<div class="panelMacro"><table class="infoMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/information.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Use the right @Inject</b><br clear="none">Struts 2 and it's core component XWork use it's own internal dependency injection container. Interestingly, you could name it JSR-330's grandma, since it is an early pre-release version of <a shape="rect" class="external-link" href="http://code.google.com/p/google-guice/" rel="nofollow">Google Guice</a> once developed by <a shape="rect" class="external-link" href="http://blog.crazybob.org/" rel="nofollow">Crazybob Lee</a> - the same Bob Lee that, together with SpringSource's Rod Johnson, lead the JSR-330 specification.
+
+<p>That said, you will find the @Inject annotation both as <tt>com.opensymphony.xwork2.inject.Inject</tt> and <tt>javax.inject.Inject</tt>. <b>Don't mix up those two - <tt>javax.inject.Inject</tt> is the one you want to use with your Struts 2 CDI plugin and CDI integration in general!</b> While you could use Struts' internal annotation as well, the effect may be strange to undefined - so check your imports!</p></td></tr></table></div>
+
+<p>Now that you are aware of that, here is the rest of the inevitable NumberGuess CDI example in Struts 2 flavour. Add a JSP view similar to this:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: html; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;%@ page contentType="text/html; charset=UTF-8" %&gt;
+&lt;%@ taglib prefix="s" uri="/struts-tags" %&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;title&gt;Numberguess&lt;/title&gt;
+&lt;/head&gt;
+
+&lt;body&gt;
+&lt;h2&gt;Numberguess Game - Struts 2 CDI Example&lt;/h2&gt;
+
+&lt;h3&gt;I've picked a number between &lt;s:property value="game.smallest"/&gt; and &lt;s:property value="game.biggest"/&gt;.
+    You have &lt;s:property value="game.remainingGuesses"/&gt;remaining guesses.&lt;/h3&gt;
+
+&lt;s:form action="guess"&gt;
+    &lt;s:textfield name="game.guess" label="Your Guess"/&gt;
+    &lt;s:submit/&gt;
+&lt;/s:form&gt;
+&lt;p/&gt;
+&lt;s:actionerror/&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
+]]></script>
+</div></div>
+
+<p>along - if not using the fabulous and recommended Struts 2 <a shape="rect" href="convention-plugin.html" title="Convention Plugin">Convention Plugin</a> - with a struts.xml like this</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;!DOCTYPE struts PUBLIC
+          "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"       
+          "http://struts.apache.org/dtds/struts-2.3.dtd"&gt;
+&lt;struts&gt;
+  &lt;constant name="struts.enable.DynamicMethodInvocation" value="false"/&gt;
+  &lt;constant name="struts.devMode" value="true"/&gt;
+  
+    &lt;package name="numberguess" extends="struts-default"&gt;
+
+        &lt;action name="NumberGuess" class="org.apache.struts2.example.cdi.NumberGuess"&gt;
+            &lt;result&gt;/WEB-INF/pages/NumberGuess.jsp&lt;/result&gt;
+        &lt;/action&gt;
+
+        &lt;action name="guess" class="org.apache.struts2.example.cdi.NumberGuess" method="guess"&gt;
+            &lt;result&gt;/WEB-INF/pages/NumberGuess.jsp&lt;/result&gt;
+        &lt;/action&gt;
+
+    &lt;/package&gt;
+
+&lt;/struts&gt;
+]]></script>
+</div></div>
+
+<p>Now you can add the business logic we want to be managed and injected by CDI. Start with two qualifier annotations:</p>
+
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+package org.apache.struts2.example.cdi;
+
+import javax.inject.Qualifier;
+import java.lang.annotation.Documented;
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@Qualifier
+public @interface Random {}
+]]></script>
+</div></div>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+package org.apache.struts2.example.cdi;
+
+import javax.inject.Qualifier;
+import java.lang.annotation.Documented;
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@Qualifier
+public @interface MaxNumber {}
+]]></script>
+</div></div>
+
+<p>Now on to the actual business beans, the Game and the Generator bean:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+package org.apache.struts2.example.cdi;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+import javax.inject.Named;
+import java.io.Serializable;
+
+@Named
+@SessionScoped
+public class Game implements Serializable {
+
+    public static final String CORRECT = "Correct !!!";
+    public static final String WRONG = "Sorry, wrong number !!!";
+
+    private int number;
+    private int guess;
+    private int smallest;
+
+    @MaxNumber
+    @Inject
+    private int maxNumber;
+
+    private int biggest;
+    private int remainingGuesses;
+
+    @Random
+    @Inject
+    Instance&lt;Integer&gt; randomNumber;
+
+    public Game() {
+    }
+
+    public int getNumber() {
+        return number;
+    }
+
+    public int getGuess() {
+        return guess;
+    }
+
+    public void setGuess( int guess ) {
+        this.guess = guess;
+    }
+
+    public int getSmallest() {
+        return smallest;
+    }
+
+    public int getBiggest() {
+        return biggest;
+    }
+
+    public int getRemainingGuesses() {
+        return remainingGuesses;
+    }
+
+    public String check() throws InterruptedException {
+        if (guess &gt; number) {
+            biggest = guess - 1;
+        }
+        if (guess &lt; number) {
+            smallest = guess + 1;
+        }
+        if (guess == number) {
+            return CORRECT;
+        }
+        remainingGuesses--;
+        return WRONG;
+    }
+
+    @PostConstruct
+    public void reset() {
+        this.smallest = 0;
+        this.guess = 0;
+        this.remainingGuesses = 10;
+        this.biggest = maxNumber;
+        this.number = randomNumber.get();
+    }
+
+}
+]]></script>
+</div></div>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+package org.apache.struts2.example.cdi;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Produces;
+import java.io.Serializable;
+
+@ApplicationScoped
+public class Generator implements Serializable {
+   
+   private java.util.Random random = new java.util.Random( System.currentTimeMillis() );
+   
+   private int maxNumber = 100;
+   
+   java.util.Random getRandom() {
+      return random;
+   }
+   
+   @Produces @Random int next() { 
+      return getRandom().nextInt(maxNumber); 
+   }
+   
+   @Produces @MaxNumber int getMaxNumber() {
+      return maxNumber;
+   }
+
+} 
+]]></script>
+</div></div>
+
+<p>If you understand that code at a glance, you are either already an CDI expert or profit from the readable, natural language oriented way the CDI stack works. If neither of this is the case, now it's time to check the CDI and Weld documentation. Remember, this is a trivial example - there is much more to know about CDI.</p>
+
+<p>Ready you are now - use the Force!</p></div>
+        </div>
+
+        
+    </div>
+</div>
+<div class="footer">
+    Generated by CXF SiteExporter
+</div>
+</body>
+</html>
\ No newline at end of file

Added: websites/production/struts/content/development/2.x/docs/chaining-interceptor.data/HibernateAction.java
==============================================================================
--- websites/production/struts/content/development/2.x/docs/chaining-interceptor.data/HibernateAction.java (added)
+++ websites/production/struts/content/development/2.x/docs/chaining-interceptor.data/HibernateAction.java Wed Jul 17 09:31:08 2013
@@ -0,0 +1,47 @@
+package cash.action;
+
+import org.apache.log4j.Logger;
+
+import com.opensymphony.xwork.ActionContext;
+import com.opensymphony.xwork.ActionSupport;
+
+/**
+ * Superclass for Hibernate-aware actions.
+ *
+ * @author Joel Hockey
+ * @version $Id: $
+ */
+public abstract class HibernateAction extends ActionSupport {
+    /** xwork action return code */
+    public static final String DBERROR = "dberror";
+
+    private static final Logger LOG = Logger.getLogger(HibernateAction.class);
+
+    private boolean m_rollback = false;
+
+    /** roll back the current session */
+    protected void setRollbackOnly() { m_rollback = true; }
+
+    /** @return whether the current Hibernate Session should be rolled back */
+    public boolean getRollback() { return m_rollback; }
+
+    /**
+     * Sets an object into the web session
+     * @param key Key used to index object
+     * @param object The object to store
+     */
+    public void set(Object key, Object object) {
+        ActionContext.getContext().getSession().put(key, object);
+    }
+
+    /**
+     * Retrieve object from web session
+     * @param key Key used to index object
+     * @return object if it exists, or null
+     */
+    public Object get(Object key) {
+        return ActionContext.getContext().getSession().get(key);
+    }
+}
+
+

Added: websites/production/struts/content/development/2.x/docs/chaining-interceptor.data/HibernateUtil.java
==============================================================================
--- websites/production/struts/content/development/2.x/docs/chaining-interceptor.data/HibernateUtil.java (added)
+++ websites/production/struts/content/development/2.x/docs/chaining-interceptor.data/HibernateUtil.java Wed Jul 17 09:31:08 2013
@@ -0,0 +1,67 @@
+package cash.util;
+
+import net.sf.hibernate.HibernateException;
+import net.sf.hibernate.SessionFactory;
+import net.sf.hibernate.Session;
+import net.sf.hibernate.cfg.Configuration;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Helper Singleton class to manage Hibernate Sessions.
+ *
+ * @author Joel Hockey
+ * @version $Id: $
+ */
+public class HibernateUtil {
+
+    /** ThreadLocal Session Map */
+    public static final ThreadLocal MAP = new ThreadLocal();
+
+    private static final Logger LOG = Logger.getLogger(HibernateUtil.class);
+
+    private static final SessionFactory SESSION_FACTORY;
+
+    /** Make default construct private */
+    private HibernateUtil() { }
+
+    /** Loads Hibernate config. */
+    static {
+        try {
+            LOG.debug("HibernateUtil.static - loading config");
+            SESSION_FACTORY = new Configuration().configure().buildSessionFactory();
+            LOG.debug("HibernateUtil.static - end");
+        } catch (HibernateException ex) {
+            throw new RuntimeException("Exception building SessionFactory: " + ex.getMessage(), ex);
+        }
+    }
+
+    /**
+     * Gets Hibernate Session for current thread.  When finished, users
+     * must return session using {@link #closeSession() closeSession()} method.
+     * @return Hibernate Session for current thread.
+     * @throws HibernateException if there is an error opening a new session.
+     */
+    public static Session currentSession() throws HibernateException {
+        Session s = (Session)MAP.get();
+        // Open a new Session, if this Thread has none yet
+        if (s == null) {
+            s = SESSION_FACTORY.openSession();
+            MAP.set(s);
+        }
+        return s;
+    }
+
+    /**
+     * Closes the Hibernate Session.  Users must call this method after calling
+     * {@link #currentSession() currentSession()}.
+     * @throws HibernateException if session has problem closing.
+     */
+    public static void closeSession() throws HibernateException {
+        Session s = (Session)MAP.get();
+        MAP.set(null);
+        if (s != null) {
+            s.close();
+        }
+    }
+}
\ No newline at end of file