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 [23/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-m...
Added: websites/production/struts/content/development/2.x/docs/nutshell.html
==============================================================================
--- websites/production/struts/content/development/2.x/docs/nutshell.html (added)
+++ websites/production/struts/content/development/2.x/docs/nutshell.html Wed Jul 17 09:31:08 2013
@@ -0,0 +1,265 @@
+<!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>Nutshell</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>
+ <a href="home.html">Home</a> > <a href="guides.html">Guides</a> > <a href="core-developers-guide.html">Core Developers Guide</a> > <a href="nutshell.html">Nutshell</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">Nutshell</div>
+
+ <div class="greynavbar" align="right" style="padding: 2px 10px; margin: 0px;">
+ <a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=45368">
+ <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=45368">Edit Page</a>
+
+ <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>
+
+ <a href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=WW&fromPageId=45368">
+ <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=45368">Add Page</a>
+
+ <a href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=WW&fromPageId=45368">
+ <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=45368">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">The framework documentation is written for active web developers and assumes a working knowledge about how Java web applications are built. For more about the underlying nuts and bolts, see the <a shape="rect" class="external-link" href="http://struts.apache.org/primer.html">Key Technologies Primer</a>.</td></tr></table></div>
+
+<h2><a shape="rect" name="Nutshell-ApacheStruts2ArchitectureinaNutshell"></a>Apache Struts 2 Architecture in a Nutshell</h2>
+
+<div class="table-wrap">
+<table class="confluenceTable"><tbody><tr><td colspan="1" rowspan="1" class="confluenceTd"> <span class="image-wrap" style=""><img src="nutshell.data/struts2-arch.png" style="border: 0px solid black"></span> </td><td colspan="1" rowspan="1" class="confluenceTd"><ol><li>The web browser requests a resource (/mypage.action, /reports/myreport.pdf, et cetera)</li><li>The Filter Dispatcher looks at the request and determines the appropriate Action</li><li>The Interceptors automatically apply common functionality to the request, like workflow, validation, and file upload handling</li><li>The Action method executes, usually storing and/or retrieving information from a database</li><li>The Result renders the output to the browser, be it HTML, images, PDF, or something else</li></ol>
+</td></tr></tbody></table>
+</div>
+
+
+<h2><a shape="rect" name="Nutshell-StrutsTagsinanutshell"></a>Struts Tags in a nutshell</h2>
+
+<p>The Struts Tags help you create rich web applications with a minimum of coding. Often, much of the coding effort in a web application goes into the pages. The Struts Tags reduce effort by reducing code.</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+<% User user = ... %>
+<form action="Profile_update.action" method="post">
+ <table>
+ <tr>
+ <td align="right"><label>First name:</label></td>
+ <td><input type="text" name="user.firstname" value="<%=user.getFirstname() %> /></td>
+ </tr>
+ <tr>
+ <td><input type="radio" name="user.gender" value="0" id="user.gender0"
+ <% if (user.getGender()==0) { %> checked="checked" %> } %> />
+ <label for="user.gender0">Female</label>
+ </tr>
+ </table>
+</form>
+...
+]]></script>
+</div></div>
+
+<p>Looking over the markup, it's easy to see why Java web development without the aid from a modern framework is hard! So far, we've only coded two controls, and there are six more to go! Let's rewrite and finish the form using Struts Tags.</p>
+
+
+<div class="table-wrap">
+<table class="confluenceTable"><tbody><tr><td colspan="1" rowspan="1" class="confluenceTd"> <span class="image-wrap" style=""><img src="nutshell.data/nutshell.GIF" style="border: 0px solid black"></span> </td><td colspan="1" rowspan="1" class="confluenceTd"> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+<s:actionerror/>
+<s:form action="Profile_update" validate="true">
+ <s:textfield label="Username" name="username"/>
+ <s:password label="Password" name="password"/>
+ <s:password label="(Repeat) Password" name="password2"/>
+ <s:textfield label="Full Name" name="fullName"/>
+ <s:textfield label="From Address" name="fromAddress"/>
+ <s:textfield label="Reply To Address" name="replyToAddress"/>
+ <s:submit value="Save" name="Save"/>
+ <s:submit action="Register_cancel" value="Cancel" name="Cancel" onclick="form.onsubmit=null"/>
+</s:form>
+]]></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">The Struts Tags also support validation and localization as first-class features. So not only is there less code, but there is <em>more</em> utility.
+
+<p>In about the same amount of code as two conventional controls, the Struts Tags can create an entire data-input form with eight controls. Not only is there less code, but the code is easier to read and maintain.</p></td></tr></table></div></td></tr></tbody></table>
+</div>
+
+
+<h2><a shape="rect" name="Nutshell-StrutsConfigurationinaNutshell"></a>Struts Configuration in a Nutshell</h2>
+
+<p>A web application uses a deployment descriptor to initialize resources like filters and listeners. The web deployment descriptor is formatted as a XML document and named <tt>web.xml</tt>. Struts can either initialize its resources by scanning your classes using Java packages declared in this <tt>web.xml</tt> file, or you can have full control over the configuration via a configuration file, named <tt>struts.xml</tt>. These resources include action mappings, to direct input to server-side Action classes, and result types, to select output pages. </p>
+
+<p>Here's a typical configuration (<tt>struts.xml</tt>) for a login workflow:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+<struts>
+ <package name="default" extends="struts-default">
+ <action name="Logon" class="mailreader2.Logon">
+ <result name="input">/pages/Logon.jsp</result>
+ <result name="cancel" type="redirectAction">Welcome</result>
+ <result type="redirectAction">MainMenu</result>
+ <result name="expired" type="chain">ChangePassword</result>
+ </action>
+
+ <action name="Logoff" class="mailreader2.Logoff">
+ <result type="redirectAction">Welcome</result>
+ </action>
+ </package>
+</struts>
+]]></script>
+</div></div>
+
+<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"> The framework provides general-purpose defaults, so we can start using Struts right away, "out of the box". Any factory defaults can be overridden in an application's configuration, as needed.</p>
+
+<h2><a shape="rect" name="Nutshell-StrutsMVCinaNutshell"></a>Struts MVC in a Nutshell</h2>
+
+<p>Struts is a <a shape="rect" class="external-link" href="http://struts.apache.org/primer.html#mvc">Model View Controller</a> framework. Struts provides Controller and View components, and integrates with other technologies to provide the Model. The framework's Controller acts as a bridge between the application's Model and the web View. </p>
+
+<p>To make it easier to present dynamic data, the framework includes a library of markup tags. The tags interact with the framework's validation and internationalization features, to ensure that input is correct and output is localized. The tag library can be used with JSP, FreeMarker, or Velocity. Of course, other tag libraries, JSTL, and AJAX can also be used, with or without the Struts tags. JavaServer Faces components are also supported.</p>
+
+<p>When a request is received, the Controller invokes an Action class. The Action class examines or updates the application's state by consulting the Model (or, preferably, an interface representing the Model). To transfer data between the Model and the View, properties can be placed on the Action class, or on a plain old JavaBean. </p>
+
+<p>Most often, the Model is represented as a graph of JavaBean objects. The Model should do the "heavy lifting", and the Action will act as a "traffic cop" or adapter. The framework provides sophisticated, automatic type conversion to simplify transfering data between rich domain objects and text-only HTTP requests. </p>
+
+<p>Struts is extensible. <em>Very</em> extensible. Every class deployed by the framework is based on an interface. We provide all the base classes an application may ever need, but if we missed something, it's easy to add your own. We provide the general-purpose framework, but you can still write <em>your</em> application <em>your</em> way.</p>
+
+<h2><a shape="rect" name="Nutshell-IsStrutsthebestchoiceforeveryproject%3F"></a>Is Struts the best choice for every project?</h2>
+
+<p>Apache Struts 2 helps you create an extensible development environment for enterprise-grade applications, based on industry standards and proven design patterns. If you need to write a very simple application, with a handful of pages, then you might consider a "Model 1" solution that uses only server pages.</p>
+
+<p>But, if you are writing a more complicated application, with dozens of pages, that need to be maintained over time, then Struts can help. For more about whether Model 1 or MVC/Model 2 is right for you, see <a shape="rect" class="external-link" href="http://www.javaworld.com/javaworld/jw-12-1999/jw-12-ssj-jspmvc.html" rel="nofollow">Understanding JavaServer Pages Model 2 architecture</a>. </p>
+
+<h2><a shape="rect" name="Nutshell-PlatformRequirements"></a>Platform Requirements </h2>
+
+<p>Struts 2 requires </p>
+
+<ul><li>Servlet API 2.4</li><li>JSP API 2.0</li><li>Java 5</li></ul>
+
+
+<p>For a full list of requirements, including dependencies used by optional plugins, see <a shape="rect" class="external-link" href="http://struts.apache.org/2.x/struts2-core/dependencies.html">Project Dependencies</a> </p>
+
+<p><img align="middle" class="emoticon" src="https://cwiki.apache.org/confluence/images/icons/emoticons/check.gif" height="16" width="16" alt="" border="0"> An alternate set of JARs for Java 4 are also available. See the "J4" distribution. </p>
+
+
+
+<h2><a shape="rect" name="Nutshell-Next%3AAJAX"></a>Next: <a shape="rect" href="ajax.html" title="AJAX">AJAX</a></h2></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/objectfactory.html
==============================================================================
--- websites/production/struts/content/development/2.x/docs/objectfactory.html (added)
+++ websites/production/struts/content/development/2.x/docs/objectfactory.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>
+ <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 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>ObjectFactory</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>
+ <a href="home.html">Home</a> > <a href="guides.html">Guides</a> > <a href="core-developers-guide.html">Core Developers Guide</a> > <a href="objectfactory.html">ObjectFactory</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">ObjectFactory</div>
+
+ <div class="greynavbar" align="right" style="padding: 2px 10px; margin: 0px;">
+ <a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=27470">
+ <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=27470">Edit Page</a>
+
+ <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>
+
+ <a href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=WW&fromPageId=27470">
+ <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=27470">Add Page</a>
+
+ <a href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=WW&fromPageId=27470">
+ <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=27470">Add News</a>
+ </div>
+ </div>
+
+ <div class="pagecontent">
+ <div class="wiki-content">
+ <div id="ConfluenceContent"><p>All objects created by the framework are instantiated by the ObjectFactory. The ObjectFactory provides the means of integrating the framework with IoC containers like Spring, Pico, Plexus, and so forth.</p>
+
+<h2><a shape="rect" name="ObjectFactory-Customize"></a>Customize</h2>
+
+<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">Customized ObjectFactory must extend ObjectFactory or any of its descendants and have a default, no-argument constructor.</td></tr></table></div>
+
+<p>To register a customized ObjectFactory, add or edit an entry in <tt>struts.properties</tt></p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+ struts.objectFactory=foo.bar.MyCustomObjectFactory
+]]></script>
+</div></div>
+<p>where foo.bar.MyCustomObjectFactory is the custom object factory. </p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+public class MyObjectFactory extends ObjectFactory {
+ .....
+}
+]]></script>
+</div></div>
+
+<h2><a shape="rect" name="ObjectFactory-Next%3AActionMapper"></a>Next: <a shape="rect" href="actionmapper.html" title="ActionMapper">ActionMapper</a></h2></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/obtain-response.html
==============================================================================
--- websites/production/struts/content/development/2.x/docs/obtain-response.html (added)
+++ websites/production/struts/content/development/2.x/docs/obtain-response.html Wed Jul 17 09:31:08 2013
@@ -0,0 +1,197 @@
+<!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>Obtain Response</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>
+ <a href="home.html">Home</a> > <a href="guides.html">Guides</a> > <a href="contributors-guide.html">Contributors Guide</a> > <a href="requirements.html">Requirements</a> > <a href="use-cases.html">Use Cases</a> > <a href="obtain-response.html">Obtain Response</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">Obtain Response</div>
+
+ <div class="greynavbar" align="right" style="padding: 2px 10px; margin: 0px;">
+ <a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=29365">
+ <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=29365">Edit Page</a>
+
+ <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>
+
+ <a href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=WW&fromPageId=29365">
+ <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=29365">Add Page</a>
+
+ <a href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=WW&fromPageId=29365">
+ <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=29365">Add News</a>
+ </div>
+ </div>
+
+ <div class="pagecontent">
+ <div class="wiki-content">
+ <div id="ConfluenceContent"><h2><a shape="rect" name="ObtainResponse-Narrative"></a>Narrative</h2>
+
+<blockquote>
+<p>Trillian goes to the MailReader website. As a first-time visitor, she needs to create an account to hold her email subscriptions. Trillian completes a form with her account information, and submits it to the system. </p>
+
+<hr>
+
+<div class="table-wrap">
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh">Username </th><td colspan="1" rowspan="1" class="confluenceTd"> trillian </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh">Password </th><td colspan="1" rowspan="1" class="confluenceTd"> ****** </td><td colspan="1" rowspan="1" class="confluenceTd"> <em>b4b3L</em> </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh">(Repeat) Password: </th><td colspan="1" rowspan="1" class="confluenceTd"> ****** </td><td colspan="1" rowspan="1" class="confluenceTd"> <em>b4b3L</em> </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh">Full Name </th><td colspan="1" rowspan="1" class="confluenceTd"> Tricia McMillian </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> From Address </th><td colspan="1" rowspan="1" class="confluenceTd"> trillian@magrathea.com </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> Reply To Address </th><td colspan="1" rowspan="1" c
lass="confluenceTd"> </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> </td><th colspan="1" rowspan="1" class="confluenceTh"> [Save] [Reset] [Cancel] </th></tr></tbody></table>
+</div>
+
+
+<hr>
+
+<p>After registering, the system displays a <b>Menu</b>, so that Trillian can edit her profile, which includes her <b>list of email subscriptions</b>, or <b>log off</b>.</p></blockquote>
+
+<h2><a shape="rect" name="ObtainResponse-Goal"></a>Goal</h2>
+
+<div class="table-wrap">
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh">Goal </th><td colspan="1" rowspan="1" class="confluenceTd"> Obtain Response</td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh">Level </th><td colspan="1" rowspan="1" class="confluenceTd"> User Goal </td><td colspan="1" rowspan="1" class="confluenceTd"> (User Goal, Summary, Subfunction) </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> Trigger </th><td colspan="1" rowspan="1" class="confluenceTd"> Submit request </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh">Primary Actor </th><td colspan="1" rowspan="1" class="confluenceTd"> Client </td></tr></tbody></table>
+</div>
+
+
+<h2><a shape="rect" name="ObtainResponse-MainSuccessScenario%28MSS%29"></a>Main Success Scenario (MSS)</h2>
+
+<div class="table-wrap">
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Step </th><th colspan="1" rowspan="1" class="confluenceTh"> Action </th></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> 1 </th><td colspan="1" rowspan="1" class="confluenceTd"> Client submits request to web server. </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> 2 </th><td colspan="1" rowspan="1" class="confluenceTd"> Web server transfers request to container, and container transfers request to framework's dispatcher. </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> 3 </th><td colspan="1" rowspan="1" class="confluenceTd"> Dispatcher consults the <a shape="rect" class="createlink" href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=WW&title=mappings&linkCreation=true&fromPageId=29365">mappings</a> to select the appropriate <a shape="rect" href="execute-action.html" title="Execute Action">action</a> and creates a <a s
hape="rect" class="createlink" href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=WW&title=context&linkCreation=true&fromPageId=29365">context</a> for the request. </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> 4 </th><td colspan="1" rowspan="1" class="confluenceTd"> Dispatcher creates and invokes a <a shape="rect" class="createlink" href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=WW&title=proxy&linkCreation=true&fromPageId=29365">proxy</a> to execute the action and its <a shape="rect" href="interceptors.html" title="Interceptors">Interceptors</a>. </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> 5 </th><td colspan="1" rowspan="1" class="confluenceTd"> The proxy manages the action pre-process, the procedess, and the post-process. </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> 6 </th><td colspan="1" rowspan="1" class="confluenceTd"> The invocation calls each int
erceptor in turn before executing the action. </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> 7 </th><td colspan="1" rowspan="1" class="confluenceTd"> Each interceptor affects the request as appropriate. </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> 8 </th><td colspan="1" rowspan="1" class="confluenceTd"> The action handles the transaction corresponding to the request. </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> 9 </th><td colspan="1" rowspan="1" class="confluenceTd"> The action returns a code indicating the appropriate <a shape="rect" class="createlink" href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=WW&title=result&linkCreation=true&fromPageId=29365">result</a>. </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> 0 </th><td colspan="1" rowspan="1" class="confluenceTd"> The invocation executes the result. </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> A </th><td
colspan="1" rowspan="1" class="confluenceTd"> The result generates the response or transfers to a resource that will render the response. </td></tr></tbody></table>
+</div>
+
+
+<h2><a shape="rect" name="ObtainResponse-Extensions"></a>Extensions</h2>
+
+<div class="table-wrap">
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Step </th><th colspan="1" rowspan="1" class="confluenceTh"> Branching Action </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> 1a </th><th colspan="1" rowspan="1" class="confluenceTh"> </th></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> .1 </th><td colspan="1" rowspan="1" class="confluenceTd"> </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> 2a </th><th colspan="1" rowspan="1" class="confluenceTh"> </th></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> .1 </th><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluen
ceTd"> <img align="middle" class="emoticon" src="https://cwiki.apache.org/confluence/images/icons/emoticons/information.gif" height="16" width="16" alt="" border="0"> </td></tr></tbody></table>
+</div>
+
+
+<hr>
+
+<h2><a shape="rect" name="ObtainResponse-PreconditionsandGuarantees"></a>Preconditions and Guarantees</h2>
+
+<div class="table-wrap">
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Preconditions </th><td colspan="1" rowspan="1" class="confluenceTd"> </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> Minimal Guarantees </th><td colspan="1" rowspan="1" class="confluenceTd"> </td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> Success Guarantees </th><td colspan="1" rowspan="1" class="confluenceTd"> </td></tr></tbody></table>
+</div>
+
+
+<h2><a shape="rect" name="ObtainResponse-StakeholdersandInterests"></a>Stakeholders and Interests</h2>
+
+<div class="table-wrap">
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Stakeholder </th><th colspan="1" rowspan="1" class="confluenceTh"> Interest </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> </td></tr></tbody></table>
+</div>
+
+
+<h2><a shape="rect" name="ObtainResponse-Variations"></a>Variations </h2>
+
+<div class="table-wrap">
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Step </th><th colspan="1" rowspan="1" class="confluenceTh"> Variation </th></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"> </th><td colspan="1" rowspan="1" class="confluenceTd"> </td></tr></tbody></table>
+</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/ognl.html
==============================================================================
--- websites/production/struts/content/development/2.x/docs/ognl.html (added)
+++ websites/production/struts/content/development/2.x/docs/ognl.html Wed Jul 17 09:31:08 2013
@@ -0,0 +1,280 @@
+<!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>OGNL</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>
+ <a href="home.html">Home</a> > <a href="guides.html">Guides</a> > <a href="tag-developers-guide.html">Tag Developers Guide</a> > <a href="ognl.html">OGNL</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">OGNL</div>
+
+ <div class="greynavbar" align="right" style="padding: 2px 10px; margin: 0px;">
+ <a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=14198">
+ <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=14198">Edit Page</a>
+
+ <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>
+
+ <a href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=WW&fromPageId=14198">
+ <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=14198">Add Page</a>
+
+ <a href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=WW&fromPageId=14198">
+ <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=14198">Add News</a>
+ </div>
+ </div>
+
+ <div class="pagecontent">
+ <div class="wiki-content">
+ <div id="ConfluenceContent"><p>OGNL is the Object Graph Navigation Language (see <a shape="rect" class="external-link" href="http://www.opensymphony.com/ognl" rel="nofollow">http://www.opensymphony.com/ognl</a> for the full documentation of OGNL). Here, we will cover a few examples of OGNL features that co-exist with the framework. To review basic concepts, refer to <a shape="rect" href="ognl-basics.html" title="OGNL Basics">OGNL Basics</a>.</p>
+
+<p>The framework uses a standard naming context to evaluate OGNL expressions. The top level object dealing with OGNL is a Map (usually referred as a context map or context). OGNL has a notion of there being a root (or default) object within the context. In expression, the properties of the root object can be referenced without any special "marker" notion. References to other objects are marked with a pound sign (<tt>#</tt>).</p>
+
+<p>The framework sets the OGNL context to be our ActionContext, and the value stack to be the OGNL root object. (The value stack is a set of several objects, but to OGNL it appears to be a single object.) Along with the value stack, the framework places other objects in the ActionContext, including Maps representing the application, session, and request contexts. These objects coexist in the ActionContext, alongside the value stack (our OGNL root).</p>
+<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
+<pre> |
+ |--application
+ |
+ |--session
+ context map---|
+ |--value stack(root)
+ |
+ |--action (the current action)
+ |
+ |--request
+ |
+ |--parameters
+ |
+ |--attr (searches page, request, session, then application scopes)
+ |
+</pre>
+</div></div>
+<p><img align="middle" class="emoticon" src="https://cwiki.apache.org/confluence/images/icons/emoticons/information.gif" height="16" width="16" alt="" border="0"> There are other objects in the context map. The diagram is for example only.</p>
+
+<p>The Action instance is always pushed onto the value stack. Because the Action is on the stack, and the stack is the OGNL root, references to Action properties can omit the <tt>#</tt> marker. But, to access other objects in the ActionContext, we must use the <tt>#</tt> notation so OGNL knows not to look in the root object, but for some other object in the ActionContext.</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Referencing an Action property</b></div><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+<s:property value="postalCode"/>
+]]></script>
+</div></div>
+<p>Other (non-root) objects in the ActionContext can be rendered use the <tt>#</tt> notation.</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+<s:property value="#session.mySessionPropKey"/> or
+<s:property value="#session['mySessionPropKey']"/> or
+<s:property value="#request['myRequestPropKey']"/>
+]]></script>
+</div></div>
+<p>The ActionContext is also exposed to Action classes via a static method.</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+ActionContext.getContext().getSession().put("mySessionPropKey", mySessionObject);
+]]></script>
+</div></div>
+<p>You can also put expression for attributes that don't support dynamic content, like below:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+<c:set var="foo" value="bar" scope="request"/>
+<s:textfield name="username" label="%{#request.foo}" />
+]]></script>
+</div></div>
+
+<h2><a shape="rect" name="OGNL-Collections%28Maps%2CLists%2CSets%29"></a>Collections (Maps, Lists, Sets)</h2>
+
+<p>Dealing with Collections (Maps, Lists, and Sets) in the framework comes often, so below please there are a few examples using the select tag. The <a shape="rect" class="external-link" href="http://www.opensymphony.com/ognl/html/LanguageGuide/collectionConstruction.html" rel="nofollow">OGNL documentation</a> also includes some examples.</p>
+
+<p>Syntax for list: {e1,e2,e3}. This idiom creates a List containing the String "name1", "name2" and "name3". It also selects "name2" as the default value.</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+<s:select label="label" name="name" list="{'name1','name2','name3'}" value="%{'name2'}" />
+]]></script>
+</div></div>
+<p>Syntax for map: #{key1:value1,key2:value2}. This idiom creates a map that maps the string "foo" to the string "foovalue" and "bar" to the string "barvalue":</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+<s:select label="label" name="name" list="#{'foo':'foovalue', 'bar':'barvalue'}" />
+]]></script>
+</div></div>
+<p>To determine if an element exists in a Collection, use the operations <tt>in</tt> and <tt>not in</tt>.</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+<s:if test="'foo' in {'foo','bar'}">
+ muhahaha
+</s:if>
+<s:else>
+ boo
+</s:else>
+
+<s:if test="'foo' not in {'foo','bar'}">
+ muhahaha
+</s:if>
+<s:else>
+ boo
+</s:else>
+]]></script>
+</div></div>
+<p>To select a subset of a collection (called projection), use a wildcard within the collection.</p>
+<ul class="alternate" type="square"><li>? - All elements matching the selection logic</li><li>^ - Only the first element matching the selection logic</li><li>$ - Only the last element matching the selection logic</li></ul>
+
+
+<p>To obtain a subset of just male relatives from the object person:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+person.relatives.{? #this.gender == 'male'}
+]]></script>
+</div></div>
+
+<h2><a shape="rect" name="OGNL-LambdaExpressions"></a>Lambda Expressions</h2>
+
+<p>OGNL supports basic lamba expression syntax enabling you to write simple functions.</p>
+
+<p>(Dedicated to all you math majors who didn't think you would ever see this one again.)</p>
+
+<p>Fibonacci: if n==0 return 0; elseif n==1 return 1; else return fib(n-2)+fib(n-1);<br clear="none">
+fib(0) = 0<br clear="none">
+fib(1) = 1<br clear="none">
+fib(11) = 89</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>How the expression works</b><br clear="none">The lambda expression is everything inside the square brackets. The #this variable holds the argument to the expression, which in the following example is the number 11 (the code after the square-bracketed lamba expression, <tt>#fib(11)</tt>).</td></tr></table></div>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+<s:property value="#fib =:[#this==0 ? 0 : #this==1 ? 1 : #fib(#this-2)+#fib(#this-1)], #fib(11)" />
+]]></script>
+</div></div>
+
+<h2><a shape="rect" name="OGNL-Next%3ATagSyntax"></a>Next: <a shape="rect" href="tag-syntax.html" title="Tag Syntax">Tag Syntax</a></h2></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>
+ $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>
\ No newline at end of file
Added: websites/production/struts/content/development/2.x/docs/optgroup.html
==============================================================================
--- websites/production/struts/content/development/2.x/docs/optgroup.html (added)
+++ websites/production/struts/content/development/2.x/docs/optgroup.html Wed Jul 17 09:31:08 2013
@@ -0,0 +1,181 @@
+<!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>optgroup</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>
+ <a href="home.html">Home</a> > <a href="guides.html">Guides</a> > <a href="tag-developers-guide.html">Tag Developers Guide</a> > <a href="struts-tags.html">Struts Tags</a> > <a href="tag-reference.html">Tag Reference</a> > <a href="ui-tag-reference.html">UI Tag Reference</a> > <a href="optgroup.html">optgroup</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">optgroup</div>
+
+ <div class="greynavbar" align="right" style="padding: 2px 10px; margin: 0px;">
+ <a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=14170">
+ <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=14170">Edit Page</a>
+
+ <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>
+
+ <a href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=WW&fromPageId=14170">
+ <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=14170">Add Page</a>
+
+ <a href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=WW&fromPageId=14170">
+ <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=14170">Add News</a>
+ </div>
+ </div>
+
+ <div class="pagecontent">
+ <div class="wiki-content">
+ <div id="ConfluenceContent"><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">Please make sure you have read the <a shape="rect" href="tag-syntax.html" title="Tag Syntax">Tag Syntax</a> document and understand how tag attribute syntax works.</td></tr></table></div>
+
+<h2><a shape="rect" name="optgroup-Description"></a>Description</h2>
+
+
+<p>Create a optgroup component which needs to resides within a select tag.</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">
+<p>This component is to be used within a Select component.</p>
+</td></tr></table></div>
+
+<h2><a shape="rect" name="optgroup-Parameters"></a>Parameters</h2>
+
+<p><table width="100%"><tr><td colspan="6" rowspan="1"><h4>Dynamic Attributes Allowed:</h4> false</td></tr><tr><td colspan="6" rowspan="1"> </td></tr><tr><th align="left" colspan="1" rowspan="1" valign="top"><h4>Name</h4></th><th align="left" colspan="1" rowspan="1" valign="top"><h4>Required</h4></th><th align="left" colspan="1" rowspan="1" valign="top"><h4>Default</h4></th><th align="left" colspan="1" rowspan="1" valign="top"><h4>Evaluated</h4></th><th align="left" colspan="1" rowspan="1" valign="top"><h4>Type</h4></th><th align="left" colspan="1" rowspan="1" valign="top"><h4>Description</h4></th></tr><tr><td align="left" colspan="1" rowspan="1" valign="top">disabled</td><td align="left" colspan="1" rowspan="1" valign="top">false</td><td align="left" colspan="1" rowspan="1" valign="top"></td><td align="left" colspan="1" rowspan="1" valign="top">false</td><td align="left" colspan="1" rowspan="1" valign="top">String</td><td align="left" colspan="1" rowspan="1" valign="top">Set t
he disable attribute.</td></tr><tr><td align="left" colspan="1" rowspan="1" valign="top">label</td><td align="left" colspan="1" rowspan="1" valign="top">false</td><td align="left" colspan="1" rowspan="1" valign="top"></td><td align="left" colspan="1" rowspan="1" valign="top">false</td><td align="left" colspan="1" rowspan="1" valign="top">String</td><td align="left" colspan="1" rowspan="1" valign="top">Set the label attribute</td></tr><tr><td align="left" colspan="1" rowspan="1" valign="top">list</td><td align="left" colspan="1" rowspan="1" valign="top">false</td><td align="left" colspan="1" rowspan="1" valign="top"></td><td align="left" colspan="1" rowspan="1" valign="top">false</td><td align="left" colspan="1" rowspan="1" valign="top">String</td><td align="left" colspan="1" rowspan="1" valign="top">Set the list attribute.</td></tr><tr><td align="left" colspan="1" rowspan="1" valign="top">listKey</td><td align="left" colspan="1" rowspan="1" valign="top">false</td><td align="left" co
lspan="1" rowspan="1" valign="top"></td><td align="left" colspan="1" rowspan="1" valign="top">false</td><td align="left" colspan="1" rowspan="1" valign="top">String</td><td align="left" colspan="1" rowspan="1" valign="top">Set the listKey attribute.</td></tr><tr><td align="left" colspan="1" rowspan="1" valign="top">listValue</td><td align="left" colspan="1" rowspan="1" valign="top">false</td><td align="left" colspan="1" rowspan="1" valign="top"></td><td align="left" colspan="1" rowspan="1" valign="top">false</td><td align="left" colspan="1" rowspan="1" valign="top">String</td><td align="left" colspan="1" rowspan="1" valign="top">Set the listValue attribute.</td></tr></table></p>
+
+
+<h2><a shape="rect" name="optgroup-Examples"></a>Examples</h2>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+
+<s:select label="My Selection"
+ name="mySelection"
+ value="%{'POPEYE'}"
+ list="%{#{'SUPERMAN':'Superman', 'SPIDERMAN':'spiderman'}}">
+ <s:optgroup label="Adult"
+ list="%{#{'SOUTH_PARK':'South Park'}}" />
+ <s:optgroup label="Japanese"
+ list="%{#{'POKEMON':'pokemon','DIGIMON':'digimon','SAILORMOON':'Sailormoon'}}" />
+</s:select>
+
+]]></script>
+</div></div></div>
+ </div>
+
+
+ </div>
+</div>
+<div class="footer">
+ Generated by CXF SiteExporter
+</div>
+</body>
+</html>
\ No newline at end of file