Added: websites/production/struts/content/docs/struts-23-to-25-migration.html
==============================================================================
--- websites/production/struts/content/docs/struts-23-to-25-migration.html
(added)
+++ websites/production/struts/content/docs/struts-23-to-25-migration.html Fri
Sep 2 05:58:25 2016
@@ -0,0 +1,214 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html>
+<head>
+ <link type="text/css" rel="stylesheet"
href="https://struts.apache.org/css/default.css">
+ <style type="text/css">
+ .dp-highlighter {
+ width:95% !important;
+ }
+ </style>
+ <style type="text/css">
+ .footer {
+ background-image:
url('https://cwiki.apache.org/confluence/images/border/border_bottom.gif');
+ background-repeat: repeat-x;
+ background-position: left top;
+ padding-top: 4px;
+ color: #666;
+ }
+ </style>
+ <link href='https://struts.apache.org/highlighter/style/shCoreStruts.css'
rel='stylesheet' type='text/css' />
+ <link href='https://struts.apache.org/highlighter/style/shThemeStruts.css'
rel='stylesheet' type='text/css' />
+ <script src='https://struts.apache.org/highlighter/js/shCore.js'
type='text/javascript'></script>
+ <script src='https://struts.apache.org/highlighter/js/shBrushPlain.js'
type='text/javascript'></script>
+ <script src='https://struts.apache.org/highlighter/js/shBrushXml.js'
type='text/javascript'></script>
+ <script src='https://struts.apache.org/highlighter/js/shBrushJava.js'
type='text/javascript'></script>
+ <script src='https://struts.apache.org/highlighter/js/shBrushJScript.js'
type='text/javascript'></script>
+ <script src='https://struts.apache.org/highlighter/js/shBrushGroovy.js'
type='text/javascript'></script>
+ <script src='https://struts.apache.org/highlighter/js/shBrushBash.js'
type='text/javascript'></script>
+ <script 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>Struts 2.3 to 2.5 migration</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="migration-guide.html">Migration Guide</a> > <a
href="struts-23-to-25-migration.html">Struts 2.3 to 2.5 migration</a>
+ </td>
+ <td align="right" valign="middle" nowrap>
+ <form name="search" action="https://www.google.com/search"
method="get">
+ <input type="hidden" name="ie" value="UTF-8" />
+ <input type="hidden" name="oe" value="UTF-8" />
+ <input type="hidden" name="domains" value="" />
+ <input type="hidden" name="sitesearch" value="" />
+ <input type="text" name="q" maxlength="255" value="" />
+ <input type="submit" name="btnG" value="Google Search" />
+ </form>
+ </td>
+ </tr>
+</table>
+
+<div id="PageContent">
+ <div class="pageheader" style="padding: 6px 0px 0px 0px;">
+ <!-- We'll enable this once we figure out how to access (and save) the
logo resource -->
+ <!--img src="/wiki/images/confluence_logo.gif" style="float: left;
margin: 4px 4px 4px 10px;" border="0"-->
+ <div style="margin: 0px 10px 0px 10px" class="smalltext">Apache Struts
2 Documentation</div>
+ <div style="margin: 0px 10px 8px 10px" class="pagetitle">Struts 2.3
to 2.5 migration</div>
+
+ <div class="greynavbar" align="right" style="padding: 2px 10px;
margin: 0px;">
+ <a
href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=65868294">
+ <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=65868294">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=65868294">
+ <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=65868294">Add
Page</a>
+
+ <a
href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=WW&fromPageId=65868294">
+ <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=65868294">Add
News</a>
+ </div>
+ </div>
+
+ <div class="pagecontent">
+ <div class="wiki-content">
+ <div id="ConfluenceContent"><h3
id="Struts2.3to2.5migration-/*<![CDATA[*/div.rbtoc1472795638836{padding:0px;}div.rbtoc1472795638836ul{list-style:disc;margin-left:0px;}div.rbtoc1472795638836li{margin-left:0px;padding-left:0px;}/*]]>*/#Struts2.3to2.5migration-Dependencies#Struts2.3to2.5migrat"><style
type="text/css">/*<![CDATA[*/
+div.rbtoc1472795638836 {padding: 0px;}
+div.rbtoc1472795638836 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1472795638836 li {margin-left: 0px;padding-left: 0px;}
+
+/*]]>*/</style></h3><div class="toc-macro rbtoc1472795638836">
+<ul class="toc-indentation"><li><a shape="rect"
href="#Struts2.3to2.5migration-"></a></li><li><a shape="rect"
href="#Struts2.3to2.5migration-Dependencies">Dependencies</a></li><li><a
shape="rect"
href="#Struts2.3to2.5migration-StrutsPrepareAndExecuteFilter">StrutsPrepareAndExecuteFilter</a></li><li><a
shape="rect" href="#Struts2.3to2.5migration-DTD">DTD</a></li><li><a
shape="rect" href="#Struts2.3to2.5migration-Tagsattributes">Tags
attributes</a></li><li><a shape="rect"
href="#Struts2.3to2.5migration-Divtag">Div tag</a></li><li><a shape="rect"
href="#Struts2.3to2.5migration-Fieldnames">Field names</a></li><li><a
shape="rect" href="#Struts2.3to2.5migration-Tiles">Tiles</a></li></ul>
+</div><h3 id="Struts2.3to2.5migration-Dependencies">Dependencies</h3><p>Update
Struts dependencies to 2.5.<br clear="none"><br clear="none">Remove the
following plugin dependencies because they were dropped and aren't supported
anymore.</p><ul><li>Dojo Plugin</li><li>Codebehind Plugin</li><li>JSF
Plugin</li><li>Struts1 Plugin</li></ul><h3
id="Struts2.3to2.5migration-StrutsPrepareAndExecuteFilter">StrutsPrepareAndExecuteFilter</h3><p>The <code>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</code>
was moved to
<code>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</code>.<br
clear="none"><br clear="none">In web.xml replace this:</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><filter>
+ <filter-name>struts2</filter-name>
+
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
+</filter></pre>
+</div></div><p>with that:</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><filter>
+ <filter-name>struts2</filter-name>
+
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
+</filter></pre>
+</div></div><p>There were other package changes, please read <a
shape="rect" href="version-notes-25.html">Version Notes 2.5</a> for more
details.</p><h3 id="Struts2.3to2.5migration-DTD">DTD</h3><p>Struts DTD was
updated to 2.5 version.<br clear="none"><br clear="none">In struts.xml replace
2.3 DTD version:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><!DOCTYPE struts PUBLIC
+ "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
+ "http://struts.apache.org/dtds/struts-2.3.dtd"></pre>
+</div></div><p>with 2.5:</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><!DOCTYPE struts PUBLIC
+ "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
+ "http://struts.apache.org/dtds/struts-2.5.dtd"></pre>
+</div></div><h3 id="Struts2.3to2.5migration-Tagsattributes">Tags
attributes</h3><p>The <code>id</code> attribute was replaced
with <code>var</code> attribute in the following
tags.</p><ul><li><code><s:action></code></li><li><code><s:append></code></li><li><code><s:bean></code></li><li><code><s:date></code></li><li><code><s:generator></code></li><li><code><s:iterator></code></li><li><code><s:merge></code></li><li><code><s:number></code></li><li><code><s:set></code></li><li><code><s:sort></code></li><li><code><s:subset></code></li><li><code><s:text></code></li><li><code><s:url></code></li></ul><p><br
clear="none">If you have something like that in your code: </p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><s:url id="url" action="login"></pre>
+</div></div><p>change it to:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><s:url var="url" action="login"></pre>
+</div></div><p><br clear="none">The <code><s:set></code>
tag <code>name</code> attribute is replaced with <code>var</code>
attribute.</p><p>From:</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><s:set id="str1" value="'string1 value'" />
+<s:set name="str2" value="'string2 value'" /></pre>
+</div></div><p>to:</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><s:set var="str1" value="'string1 value'" />
+<s:set var="str2" value="'string2 value'" /></pre>
+</div></div><p>Also <code>escape</code> attribute was renamed
to <code>escapeHtml</code> attribute.</p><p>From:</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><s:property escape="true"
var="someProperty"/></pre>
+</div></div><p>to:</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><s:property escapeHtml="true"
var="someProperty"/></pre>
+</div></div><h3 id="Struts2.3to2.5migration-Divtag">Div
tag</h3><p>The <code><s:div></code> tag was dropped.<br
clear="none"><br clear="none">Replace <code><s:div></code> with
plain HTML <code><div></code> tag.</p><h3
id="Struts2.3to2.5migration-Fieldnames">Field names</h3><p>If you have field
names which starts with single lower case letter, for example:</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">private String sTrng;
+public String getSTrng() {...}
+public void setSTrng(String str) {...}</pre>
+</div></div><p><br clear="none">change accessors to <code>getsTrng</code>
and <code>setsTrng</code>.<br clear="none"><br clear="none">Or better yet,
change field names to not contain single lower case letter:</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">private String strng;
+public String getStrng() {...}
+public void setStrng(String str) {...}</pre>
+</div></div><p><br clear="none">For additional info see <a shape="rect"
class="external-link"
href="https://issues.apache.org/jira/browse/WW-3909">WW-3909</a>.</p><h3
id="Struts2.3to2.5migration-Tiles">Tiles</h3><p>Depending on from which version
of struts you upgrade and whether you used <code>tiles-plugin</code> or
<code>tiles3-plugin</code> you may need to do different steps.</p><p>Struts 2.5
just provides a <code>tiles-plugin</code> which uses Tiles3. So support for
Tiles2 has been dropped as well as the name
<code>tiles3-plugin</code>.</p><p>Now the only maven dependency looks like
this:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>maven
dependecy for tiles-plugin</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"> <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-tiles-plugin</artifactId>
+ <version>${struts2.version}</version>
+ </dependency></pre>
+</div></div><p> </p><p>You may need to update DTD in your<code>
tiles.xml</code> files to Tiles3:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeHeader panelHeader pdl"
style="border-bottom-width: 1px;"><b>tiles3 dtd</b></div><div
class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_3_0.dtd"></pre>
+</div></div><p> </p><p>A Listener in <code>web.xml</code> is required. It
is not necessary to configure paths to <code>tiles.xml</code> files here as
they are picked up automatically.</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeHeader panelHeader pdl"
style="border-bottom-width: 1px;"><b>StrutsTilesListener in
web.xml</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><listener>
+
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
+</listener>
+
+</pre>
+</div></div><p> </p><p>Optionally you may remove TilesDefinitions from
XML and annotate actions instead. See <a shape="rect"
href="tiles-plugin.html">Tiles Plugin</a> for more
details.</p><p> </p><p> </p></div>
+ </div>
+
+
+ </div>
+</div>
+<div class="footer">
+ Generated by CXF SiteExporter
+</div>
+</body>
+</html>
Modified: websites/production/struts/content/docs/webxml.html
==============================================================================
--- websites/production/struts/content/docs/webxml.html (original)
+++ websites/production/struts/content/docs/webxml.html Fri Sep 2 05:58:25 2016
@@ -139,16 +139,16 @@ under the License.
<div class="pagecontent">
<div class="wiki-content">
<div id="ConfluenceContent"><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1468563267575 {padding: 0px;}
-div.rbtoc1468563267575 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1468563267575 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1472795637712 {padding: 0px;}
+div.rbtoc1472795637712 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1472795637712 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1468563267575">
+/*]]>*/</style></p><div class="toc-macro rbtoc1472795637712">
<ul class="toc-indentation"><li><a shape="rect"
href="#web.xml-SimpleExample">Simple Example</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#web.xml-ChangedfilterpackageinStruts>=2.5">Changed filter package in
Struts >= 2.5</a></li><li><a shape="rect"
href="#web.xml-ChangedFilterStructureinStruts>=2.1.3">Changed Filter
Structure in Struts >= 2.1.3</a></li><li><a shape="rect"
href="#web.xml-ExcludespecificURLs">Exclude specific URLs</a></li></ul>
</li><li><a shape="rect" href="#web.xml-TaglibExample">Taglib
Example</a></li><li><a shape="rect"
href="#web.xml-CustomFileManagerandFileManagerFactoryimplementations">Custom
FileManager and FileManagerFactory implementations</a></li><li><a shape="rect"
href="#web.xml-Customconfigurationprovider">Custom configuration
provider</a></li></ul>
-</div><p>The <code>web.xml</code> web application descriptor file represents
the core of the Java web application, so it is appropriate that it is also part
of the core of the Struts framework. In the <code>web.xml</code> file, Struts
defines its FilterDispatcher, the Servlet Filter class that initializes the
Struts framework and handles all requests. This filter can contain
initialization parameters that affect what, if any, additional configuration
files are loaded and how the framework should behave.</p><h1
id="web.xml-SimpleExample">Simple Example</h1><p>Configuring
<code>web.xml</code> for the framework is a matter of adding a filter and
filter-mapping.</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width:
1px;"><b>FilterDispatcher Example (web.xml)</b></div><div class="codeContent
panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><web-app id="MyStrutsApp" version="2.4"
+</div><p>The <code>web.xml</code> web application descriptor file represents
the core of the Java web application, so it is appropriate that it is also part
of the core of the Struts framework. In the <code>web.xml</code> file, Struts
defines its FilterDispatcher, the Servlet Filter class that initializes the
Struts framework and handles all requests. This filter can contain
initialization parameters that affect what, if any, additional configuration
files are loaded and how the framework should behave.</p><h1
id="web.xml-SimpleExample">Simple Example</h1><p>Configuring
<code>web.xml</code> for the framework is a matter of adding a filter and
filter-mapping.</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Filter
Example (web.xml)</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"><web-app id="MyStrutsApp" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
@@ -167,7 +167,7 @@ div.rbtoc1468563267575 li {margin-left:
</web-app>
</pre>
-</div></div><h2 id="web.xml-ChangedfilterpackageinStruts>=2.5">Changed
filter package in Struts >= 2.5</h2><p><span>As from Struts 2.5 all filters
were moved to dedicated package, see the example:</span></p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h2 id="web.xml-ChangedfilterpackageinStruts>=2.5">Changed
filter package in Struts >= 2.5</h2><p><span>As from Struts 2.5 all filters
were moved to top package, if you are using older version you must use the old
package, see example:</span></p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><web-app id="WebApp_9" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -175,7 +175,7 @@ div.rbtoc1468563267575 li {margin-left:
<filter>
<filter-name>struts2</filter-name>
-
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
+
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
...</pre>
</div></div><h2 id="web.xml-ChangedFilterStructureinStruts>=2.1.3">Changed
Filter Structure in Struts >= 2.1.3</h2><p><span>To split up the the
dispatcher phases, FilterDispatcher is deprecated since Struts 2.1.3. If
working with older versions, you need to use</span></p><div class="code panel
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"> ...