This is an automated email from the ASF dual-hosted git repository.
git-site-role pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/struts-site.git
The following commit(s) were added to refs/heads/asf-site by this push:
new e2fb1b1 Updates production by Jenkins
e2fb1b1 is described below
commit e2fb1b17f26a76b26b5a061f090fff493d0536bb
Author: jenkins <[email protected]>
AuthorDate: Thu Oct 5 07:39:09 2017 +0000
Updates production by Jenkins
---
content/core-developers/chain-result.html | 4 +-
content/core-developers/dispatcher-result.html | 22 ++-
content/core-developers/freemarker-result.html | 38 ++---
content/core-developers/httpheader-result.html | 49 +++---
content/core-developers/plaintext-result.html | 4 +-
.../core-developers/redirect-action-result.html | 118 +++++++------
content/core-developers/redirect-result.html | 72 ++++----
content/core-developers/result-types.html | 8 +-
content/core-developers/stream-result.html | 129 +++++++-------
content/core-developers/xsl-result.html | 189 +++++++--------------
10 files changed, 297 insertions(+), 336 deletions(-)
diff --git a/content/core-developers/chain-result.html
b/content/core-developers/chain-result.html
index 8e5aad6..74dddd1 100644
--- a/content/core-developers/chain-result.html
+++ b/content/core-developers/chain-result.html
@@ -125,8 +125,10 @@
<article class="container">
<section class="col-md-12">
- <a href="index.html" title="back to Core Developers Guide"><< back to Core
Developers Guide</a>
<a class="edit-on-gh"
href="https://github.com/apache/struts-site/edit/master/source/core-developers/chain-result.md"
title="Edit this page on GitHub">Edit on GitHub</a>
+
+ <a href="index.html" title="back to Core Developer Guide"><< back to Core
Developer Guide</a>
+
<h1 id="chain-result">Chain Result</h1>
<p>This result invokes an entire other action, complete with it’s own
interceptor stack and result.</p>
diff --git a/content/core-developers/dispatcher-result.html
b/content/core-developers/dispatcher-result.html
index 67a41cf..2096f72 100644
--- a/content/core-developers/dispatcher-result.html
+++ b/content/core-developers/dispatcher-result.html
@@ -125,28 +125,36 @@
<article class="container">
<section class="col-md-12">
- <a href="index.html" title="back to Core Developers Guide"><< back to Core
Developers Guide</a>
<a class="edit-on-gh"
href="https://github.com/apache/struts-site/edit/master/source/core-developers/dispatcher-result.md"
title="Edit this page on GitHub">Edit on GitHub</a>
+
+ <a href="index.html" title="back to Core Developer Guide"><< back to Core
Developer Guide</a>
+
<h1 id="dispatcher-result">Dispatcher Result</h1>
-<p>Includes or forwards to a view (usually a jsp). Behind the scenes Struts
will use a <code class="highlighter-rouge">RequestDispatcher</code>, where the
target servlet/JSP receives the same request/response objects as the original
servlet/JSP. Therefore, you can pass data between them using <code
class="highlighter-rouge">request.setAttribute()</code> - the Struts action is
available.</p>
+<p>Includes or forwards to a view (usually a jsp). Behind the scenes Struts
will use a <code class="highlighter-rouge">RequestDispatcher</code>, where
+the target servlet/JSP receives the same request/response objects as the
original servlet/JSP. Therefore, you can pass
+data between them using <code
class="highlighter-rouge">request.setAttribute()</code> - the Struts action is
available.</p>
<p>There are three possible ways the result can be executed:</p>
<ul>
- <li>If we are in the scope of a JSP (a PageContext is available),
PageContext’s <code class="highlighter-rouge"><span class="p">{</span><span
class="err">@link</span><span class="w"> </span><span
class="err">PageContext#include(String)</span><span class="w"> </span><span
class="err">include</span><span class="p">}</span></code> method is called.</li>
- <li>If there is no PageContext and we’re not in any sort of include (there
is no “javax.servlet.include.servlet_path” in the request attributes), then a
call to <code class="highlighter-rouge"><span class="p">{</span><span
class="err">@link</span><span class="w"> </span><span
class="err">RequestDispatcher#forward(javax.servlet.ServletRequest,</span><span
class="w"> </span><span class="err">javax.servlet.ServletResponse)</span><span
class="w"> </span><span class="err">forward</span><spa [...]
- <li>Otherwise, <code class="highlighter-rouge"><span class="p">{</span><span
class="err">@link</span><span class="w"> </span><span
class="err">RequestDispatcher#include(javax.servlet.ServletRequest,</span><span
class="w"> </span><span class="err">javax.servlet.ServletResponse)</span><span
class="w"> </span><span class="err">include</span><span
class="p">}</span></code> is called.</li>
+ <li>If we are in the scope of a JSP (a PageContext is available),
PageContext’s <code class="highlighter-rouge"><span class="p">{</span><span
class="err">@link</span><span class="w"> </span><span
class="err">PageContext#include(String)</span><span class="w"> </span><span
class="err">include</span><span class="p">}</span></code>
+method is called.</li>
+ <li>If there is no PageContext and we’re not in any sort of include (there
is no <code class="highlighter-rouge">javax.servlet.include.servlet_path</code>
+in the request attributes), then a call to <code
class="highlighter-rouge"><span class="p">{</span><span
class="err">@link</span><span class="w"> </span><span
class="err">RequestDispatcher#forward(javax.servlet.ServletRequest,</span><span
class="w"> </span><span class="err">javax.servlet.ServletResponse)</span><span
class="w"> </span><span class="err">forward</span><span
class="p">}</span></code>
+is made.</li>
+ <li>Otherwise, <code class="highlighter-rouge"><span class="p">{</span><span
class="err">@link</span><span class="w"> </span><span
class="err">RequestDispatcher#include(javax.servlet.ServletRequest,</span><span
class="w"> </span><span class="err">javax.servlet.ServletResponse)</span><span
class="w"> </span><span class="err">include</span><span
class="p">}</span></code>
+is called.</li>
</ul>
-<h4 id="parameters">Parameters</h4>
+<h2 id="parameters">Parameters</h2>
<ul>
<li><code class="highlighter-rouge">location</code> (default) - the location
to go to after execution (ex. jsp).</li>
<li><code class="highlighter-rouge">parse</code> - true by default. If set
to false, the location param will not be parsed for OGNL expressions.</li>
</ul>
-<h4 id="examples">Examples</h4>
+<h2 id="examples">Examples</h2>
<div class="highlighter-rouge"><pre class="highlight"><code><span
class="nt"><result</span> <span class="na">name=</span><span
class="s">"success"</span> <span class="na">type=</span><span
class="s">"dispatcher"</span><span class="nt">></span>
<span class="nt"><param</span> <span class="na">name=</span><span
class="s">"location"</span><span class="nt">></span>foo.jsp<span
class="nt"></param></span>
diff --git a/content/core-developers/freemarker-result.html
b/content/core-developers/freemarker-result.html
index 563cc56..781cb61 100644
--- a/content/core-developers/freemarker-result.html
+++ b/content/core-developers/freemarker-result.html
@@ -125,43 +125,35 @@
<article class="container">
<section class="col-md-12">
- <a href="index.html" title="back to Core Developers Guide"><< back to Core
Developers Guide</a>
<a class="edit-on-gh"
href="https://github.com/apache/struts-site/edit/master/source/core-developers/freemarker-result.md"
title="Edit this page on GitHub">Edit on GitHub</a>
+
+ <a href="index.html" title="back to Core Developer Guide"><< back to Core
Developer Guide</a>
+
<h1 id="freemarker-result">FreeMarker Result</h1>
-<p>Renders a view using the Freemarker template engine. The <code
class="highlighter-rouge">FreemarkarManager</code> class configures the
template loaders so that the template location can be either</p>
+<p>Renders a view using the Freemarker template engine. The <code
class="highlighter-rouge">FreemarkarManager</code> class configures the
template loaders
+so that the template location can be either</p>
<ul>
- <li>
- <p>relative to the web root folder, e.g.: <code
class="highlighter-rouge">/WEB-INF/views/home.ftl</code></p>
- </li>
- <li>
- <p>a classpath resource, e.g.: <code
class="highlighter-rouge">/com/company/web/views/home.ftl</code></p>
- </li>
+ <li>relative to the web root folder, e.g.: <code
class="highlighter-rouge">/WEB-INF/views/home.ftl</code></li>
+ <li>a classpath resource, e.g.: <code
class="highlighter-rouge">/com/company/web/views/home.ftl</code></li>
</ul>
<p>Also see <a href="freemarker-support.html">Freemarker Support</a>.</p>
-<h4 id="parameters">Parameters</h4>
+<h2 id="parameters">Parameters</h2>
<ul>
- <li>
- <p><code class="highlighter-rouge">location</code> (default) - the
location of the template to process.</p>
- </li>
- <li>
- <p><code class="highlighter-rouge">parse</code>- true by default. If set
to false, the location param will not be parsed for expressions.</p>
- </li>
- <li>
- <p><code class="highlighter-rouge">contentType</code> - defaults to <code
class="highlighter-rouge">text/html</code> unless specified.</p>
- </li>
- <li>
- <p><code class="highlighter-rouge">writeIfCompleted</code> - <code
class="highlighter-rouge">false</code> by default, write to stream only if
there isn’t any error processing the template. Setting <code
class="highlighter-rouge">template_exception_handler=rethrow</code> in <code
class="highlighter-rouge">freemarker.properties</code> will have the same
effect.</p>
- </li>
+ <li><code class="highlighter-rouge">location</code> (default) - the location
of the template to process.</li>
+ <li><code class="highlighter-rouge">parse</code>- true by default. If set to
false, the location param will not be parsed for expressions.</li>
+ <li><code class="highlighter-rouge">contentType</code> - defaults to <code
class="highlighter-rouge">text/html</code> unless specified.</li>
+ <li><code class="highlighter-rouge">writeIfCompleted</code> - <code
class="highlighter-rouge">false</code> by default, write to stream only if
there isn’t any error processing the template.
+Setting <code
class="highlighter-rouge">template_exception_handler=rethrow</code> in <code
class="highlighter-rouge">freemarker.properties</code> will have the same
effect.</li>
</ul>
-<h4 id="examples">Examples</h4>
+<h2 id="examples">Examples</h2>
-<div class="highlighter-rouge"><pre class="highlight"><code><result
name="success" type="freemarker">foo.ftl</result>
+<div class="highlighter-rouge"><pre class="highlight"><code><span
class="nt"><result</span> <span class="na">name=</span><span
class="s">"success"</span> <span class="na">type=</span><span
class="s">"freemarker"</span><span class="nt">></span>foo.ftl<span
class="nt"></result></span>
</code></pre>
</div>
diff --git a/content/core-developers/httpheader-result.html
b/content/core-developers/httpheader-result.html
index 4af20b0..1c737f8 100644
--- a/content/core-developers/httpheader-result.html
+++ b/content/core-developers/httpheader-result.html
@@ -125,44 +125,37 @@
<article class="container">
<section class="col-md-12">
- <a href="index.html" title="back to Core Developers Guide"><< back to Core
Developers Guide</a>
<a class="edit-on-gh"
href="https://github.com/apache/struts-site/edit/master/source/core-developers/httpheader-result.md"
title="Edit this page on GitHub">Edit on GitHub</a>
+
+ <a href="index.html" title="back to Core Developer Guide"><< back to Core
Developer Guide</a>
+
<h1 id="httpheader-result">HttpHeader Result</h1>
-<p>A custom Result type for setting HTTP headers and status by optionally
evaluating against the ValueStack. This result can also be used to send an
error to the client. All the parameters can be evaluated against the
ValueStack.</p>
+<p>A custom Result type for setting HTTP headers and status by optionally
evaluating against the ValueStack. This result
+can also be used to send an error to the client. All the parameters can be
evaluated against the ValueStack.</p>
-<h3 id="parameters">Parameters</h3>
+<h2 id="parameters">Parameters</h2>
<ul>
- <li>
- <p><code class="highlighter-rouge">status</code> - the http servlet
response status code that should be set on a response.</p>
- </li>
- <li>
- <p><code class="highlighter-rouge">parse</code> - true by default. If set
to false, the headers param will not be parsed for OGNL expressions.</p>
- </li>
- <li>
- <p><code class="highlighter-rouge">headers</code> - header values.</p>
- </li>
- <li>
- <p><code class="highlighter-rouge">error</code> - the http servlet
response error code that should be set on a response.</p>
- </li>
- <li>
- <p><code class="highlighter-rouge">errorMessage</code> - error message to
be set on response if ‘error’ is set.</p>
- </li>
+ <li><code class="highlighter-rouge">status</code> - the http servlet
response status code that should be set on a response.</li>
+ <li><code class="highlighter-rouge">parse</code> - true by default. If set
to false, the headers param will not be parsed for OGNL expressions.</li>
+ <li><code class="highlighter-rouge">headers</code> - header values.</li>
+ <li><code class="highlighter-rouge">error</code> - the http servlet response
error code that should be set on a response.</li>
+ <li><code class="highlighter-rouge">errorMessage</code> - error message to
be set on response if ‘error’ is set.</li>
</ul>
-<h3 id="examples">Examples</h3>
+<h2 id="examples">Examples</h2>
-<div class="highlighter-rouge"><pre class="highlight"><code><result
name="success" type="httpheader">
- <param name="status">204</param>
- <param name="headers.a">a custom header value</param>
- <param name="headers.b">another custom header value</param>
-</result>
+<div class="highlighter-rouge"><pre class="highlight"><code><span
class="nt"><result</span> <span class="na">name=</span><span
class="s">"success"</span> <span class="na">type=</span><span
class="s">"httpheader"</span><span class="nt">></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"status"</span><span class="nt">></span>204<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"headers.a"</span><span class="nt">></span>a custom header
value<span class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"headers.b"</span><span class="nt">></span>another custom header
value<span class="nt"></param></span>
+<span class="nt"></result></span>
-<result name="proxyRequired" type="httpheader">
- <param name="error">305</param>
- <param name="errorMessage">this action must be accessed through a
proxy</param>
-</result>
+<span class="nt"><result</span> <span class="na">name=</span><span
class="s">"proxyRequired"</span> <span class="na">type=</span><span
class="s">"httpheader"</span><span class="nt">></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"error"</span><span class="nt">></span>305<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"errorMessage"</span><span class="nt">></span>this action must be
accessed through a proxy<span class="nt"></param></span>
+<span class="nt"></result></span>
</code></pre>
</div>
diff --git a/content/core-developers/plaintext-result.html
b/content/core-developers/plaintext-result.html
index b2c1ebc..4fef4cf 100644
--- a/content/core-developers/plaintext-result.html
+++ b/content/core-developers/plaintext-result.html
@@ -125,8 +125,10 @@
<article class="container">
<section class="col-md-12">
- <a href="index.html" title="back to Core Developers Guide"><< back to Core
Developers Guide</a>
<a class="edit-on-gh"
href="https://github.com/apache/struts-site/edit/master/source/core-developers/plaintext-result.md"
title="Edit this page on GitHub">Edit on GitHub</a>
+
+ <a href="index.html" title="back to Core Developer Guide"><< back to Core
Developer Guide</a>
+
<h1 id="plaintext-result">PlainText Result</h1>
<h2 id="description">Description</h2>
diff --git a/content/core-developers/redirect-action-result.html
b/content/core-developers/redirect-action-result.html
index 8cac819..ae36679 100644
--- a/content/core-developers/redirect-action-result.html
+++ b/content/core-developers/redirect-action-result.html
@@ -125,90 +125,98 @@
<article class="container">
<section class="col-md-12">
- <a href="index.html" title="back to Core Developers Guide"><< back to Core
Developers Guide</a>
<a class="edit-on-gh"
href="https://github.com/apache/struts-site/edit/master/source/core-developers/redirect-action-result.md"
title="Edit this page on GitHub">Edit on GitHub</a>
+
+ <a href="index.html" title="back to Core Developer Guide"><< back to Core
Developer Guide</a>
+
<h1 id="redirect-action-result">Redirect Action Result</h1>
-<p>This result uses the <code class="highlighter-rouge">ActionMapper</code>
provided by the <code class="highlighter-rouge">ActionMapperFactory</code> to
redirect the browser to a URL that invokes the specified action and (optional)
namespace. This is better than the <code
class="highlighter-rouge">ServletRedirectResult</code> because it does not
require you to encode the URL patterns processed by the <code
class="highlighter-rouge">ActionMapper</code> in to your struts.xml
configuration [...]
+<p>This result uses the <code class="highlighter-rouge">ActionMapper</code>
provided by the <code class="highlighter-rouge">ActionMapperFactory</code> to
redirect the browser to a URL that invokes
+the specified action and (optional) namespace. This is better than the <code
class="highlighter-rouge">ServletRedirectResult</code> because it does not
require
+you to encode the URL patterns processed by the <code
class="highlighter-rouge">ActionMapper</code> in to your struts.xml
configuration files. This means
+you can change your URL patterns at any point and your application will still
work. It is strongly recommended that if you
+are redirecting to another action, you use this result rather than the
standard redirect result.</p>
<p>See examples below for an example of how request parameters could be passed
in.</p>
<p>See <a href="action-mapper.html">ActionMapper</a> for more details</p>
-<h3 id="parameters">Parameters</h3>
+<h2 id="parameters">Parameters</h2>
<ul>
<li><code class="highlighter-rouge">actionName</code> (default) - The name
of the action that will be redirected to.</li>
- <li><code class="highlighter-rouge">namespace</code> - Used to determine
which namespace the action is in that we’re redirecting to. If namespace is
null, the default will be the current namespace.</li>
- <li><code class="highlighter-rouge">suppressEmptyParameters</code> -
Optional boolean (defaults to false) that can prevent parameters with no values
from being included in the redirect URL.</li>
+ <li><code class="highlighter-rouge">namespace</code> - Used to determine
which namespace the action is in that we’re redirecting to. If namespace is
null,
+the default will be the current namespace.</li>
+ <li><code class="highlighter-rouge">suppressEmptyParameters</code> -
Optional boolean (defaults to false) that can prevent parameters with no values
from being
+included in the redirect URL.</li>
<li><code class="highlighter-rouge">parse</code> - Boolean, true by default.
If set to false, the actionName param will not be parsed for OGNL
expressions.</li>
<li><code class="highlighter-rouge">anchor</code> - Optional. Also known as
“fragment” or colloquially as “hash”. You can specify an anchor for a
result.</li>
</ul>
-<h3 id="examples">Examples</h3>
+<h2 id="examples">Examples</h2>
-<div class="highlighter-rouge"><pre class="highlight"><code><package
name="public" extends="struts-default">
- <action name="login" class="...">
- <!-- Redirect to another namespace -->
- <result type="redirectAction">
- <param name="actionName">dashboard</param>
- <param name="namespace">/secure</param>
- </result>
- </action>
-</package>
+<div class="highlighter-rouge"><pre class="highlight"><code><span
class="nt"><package</span> <span class="na">name=</span><span
class="s">"public"</span> <span class="na">extends=</span><span
class="s">"struts-default"</span><span class="nt">></span>
+ <span class="nt"><action</span> <span class="na">name=</span><span
class="s">"login"</span> <span class="na">class=</span><span
class="s">"..."</span><span class="nt">></span>
+ <span class="c"><!-- Redirect to another namespace --></span>
+ <span class="nt"><result</span> <span class="na">type=</span><span
class="s">"redirectAction"</span><span class="nt">></span>
+ <span class="nt"><param</span> <span
class="na">name=</span><span class="s">"actionName"</span><span
class="nt">></span>dashboard<span class="nt"></param></span>
+ <span class="nt"><param</span> <span
class="na">name=</span><span class="s">"namespace"</span><span
class="nt">></span>/secure<span class="nt"></param></span>
+ <span class="nt"></result></span>
+ <span class="nt"></action></span>
+<span class="nt"></package></span>
-<package name="secure" extends="struts-default" namespace="/secure">
- <-- Redirect to an action in the same namespace -->
- <action name="dashboard" class="...">
- <result>dashboard.jsp</result>
- <result name="error" type="redirectAction">error</result>
- </action>
+<span class="nt"><package</span> <span class="na">name=</span><span
class="s">"secure"</span> <span class="na">extends=</span><span
class="s">"struts-default"</span> <span class="na">namespace=</span><span
class="s">"/secure"</span><span class="nt">></span>
+ <span class="nt"><--</span> <span class="err">Redirect</span> <span
class="err">to</span> <span class="err">an</span> <span
class="err">action</span> <span class="err">in</span> <span
class="err">the</span> <span class="err">same</span> <span
class="err">namespace</span> <span class="err">--</span><span
class="nt">></span>
+ <span class="nt"><action</span> <span class="na">name=</span><span
class="s">"dashboard"</span> <span class="na">class=</span><span
class="s">"..."</span><span class="nt">></span>
+ <span class="nt"><result></span>dashboard.jsp<span
class="nt"></result></span>
+ <span class="nt"><result</span> <span class="na">name=</span><span
class="s">"error"</span> <span class="na">type=</span><span
class="s">"redirectAction"</span><span class="nt">></span>error<span
class="nt"></result></span>
+ <span class="nt"></action></span>
- <action name="error" class="...">
- <result>error.jsp</result>
- </action>
-</package>
+ <span class="nt"><action</span> <span class="na">name=</span><span
class="s">"error"</span> <span class="na">class=</span><span
class="s">"..."</span><span class="nt">></span>
+ <span class="nt"><result></span>error.jsp<span
class="nt"></result></span>
+ <span class="nt"></action></span>
+<span class="nt"></package></span>
-<package name="passingRequestParameters" extends="struts-default"
namespace="/passingRequestParameters">
- <!-- Pass parameters (reportType, width and height) -->
- <!--
+<span class="nt"><package</span> <span class="na">name=</span><span
class="s">"passingRequestParameters"</span> <span
class="na">extends=</span><span class="s">"struts-default"</span> <span
class="na">namespace=</span><span
class="s">"/passingRequestParameters"</span><span class="nt">></span>
+ <span class="c"><!-- Pass parameters (reportType, width and height)
--></span>
+ <span class="c"><!--
The redirectAction url generated will be :
/genReport/generateReport.action?reportType=pie&amp;width=100&amp;height=100#summary
- -->
- <action name="gatherReportInfo" class="...">
- <result name="showReportResult" type="redirectAction">
- <param name="actionName">generateReport</param>
- <param name="namespace">/genReport</param>
- <param name="reportType">pie</param>
- <param name="width">100</param>
- <param name="height">100</param>
- <param name="empty"></param>
- <param name="suppressEmptyParameters">true</param>
- <param name="anchor">summary</param>
- </result>
- </action>
-</package>
+ --></span>
+ <span class="nt"><action</span> <span class="na">name=</span><span
class="s">"gatherReportInfo"</span> <span class="na">class=</span><span
class="s">"..."</span><span class="nt">></span>
+ <span class="nt"><result</span> <span class="na">name=</span><span
class="s">"showReportResult"</span> <span class="na">type=</span><span
class="s">"redirectAction"</span><span class="nt">></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"actionName"</span><span class="nt">></span>generateReport<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"namespace"</span><span class="nt">></span>/genReport<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"reportType"</span><span class="nt">></span>pie<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"width"</span><span class="nt">></span>100<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"height"</span><span class="nt">></span>100<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"empty"</span><span class="nt">></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"suppressEmptyParameters"</span><span class="nt">></span>true<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"anchor"</span><span class="nt">></span>summary<span
class="nt"></param></span>
+ <span class="nt"></result></span>
+ <span class="nt"></action></span>
+<span class="nt"></package></span>
</code></pre>
</div>
-<div class="highlighter-rouge"><pre class="highlight"><code><!--
+<div class="highlighter-rouge"><pre class="highlight"><code><span
class="c"><!--
Example of "anchor" param usage in conjunction with "redirectAction"
result-type.
Generated URL: /displayReport.action#SUMMARY
--->
+--></span>
-<action name="displayReport">
- <result>/jsp/displayReport.jsp</result>
-</action>
+<span class="nt"><action</span> <span class="na">name=</span><span
class="s">"displayReport"</span><span class="nt">></span>
+ <span class="nt"><result></span>/jsp/displayReport.jsp<span
class="nt"></result></span>
+<span class="nt"></action></span>
-<action name="financeReport"
class="com.mycompany.reports.FinanceReportAction">
- <result name="input">/jsp/index.jsp</result>
- <result name="success" type="redirectAction">
- <param name="actionName">displayReport</param>
- <param name="parse">false</param>
- <param name="anchor">SUMMARY</param>
- </result>
-</action>
+<span class="nt"><action</span> <span class="na">name=</span><span
class="s">"financeReport"</span> <span class="na">class=</span><span
class="s">"com.mycompany.reports.FinanceReportAction"</span><span
class="nt">></span>
+ <span class="nt"><result</span> <span class="na">name=</span><span
class="s">"input"</span><span class="nt">></span>/jsp/index.jsp<span
class="nt"></result></span>
+ <span class="nt"><result</span> <span class="na">name=</span><span
class="s">"success"</span> <span class="na">type=</span><span
class="s">"redirectAction"</span><span class="nt">></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"actionName"</span><span class="nt">></span>displayReport<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"parse"</span><span class="nt">></span>false<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"anchor"</span><span class="nt">></span>SUMMARY<span
class="nt"></param></span>
+ <span class="nt"></result></span>
+<span class="nt"></action></span>
</code></pre>
</div>
diff --git a/content/core-developers/redirect-result.html
b/content/core-developers/redirect-result.html
index 358b862..117f84d 100644
--- a/content/core-developers/redirect-result.html
+++ b/content/core-developers/redirect-result.html
@@ -125,59 +125,59 @@
<article class="container">
<section class="col-md-12">
- <a href="index.html" title="back to Core Developers Guide"><< back to Core
Developers Guide</a>
<a class="edit-on-gh"
href="https://github.com/apache/struts-site/edit/master/source/core-developers/redirect-result.md"
title="Edit this page on GitHub">Edit on GitHub</a>
+
+ <a href="index.html" title="back to Core Developer Guide"><< back to Core
Developer Guide</a>
+
<h1 id="redirect-result">Redirect Result</h1>
-<p>Calls the <code class="highlighter-rouge"><span class="p">{</span><span
class="err">@link</span><span class="w"> </span><span
class="err">HttpServletResponse#sendRedirect(String)</span><span class="w">
</span><span class="err">sendRedirect</span><span class="p">}</span></code>
method to the location specified. The response is told to redirect the browser
to the specified location (a new request from the client). The consequence of
doing this means that the action (action instance, act [...]
+<p>Calls the <code class="highlighter-rouge"><span class="p">{</span><span
class="err">@link</span><span class="w"> </span><span
class="err">HttpServletResponse#sendRedirect(String)</span><span class="w">
</span><span class="err">sendRedirect</span><span class="p">}</span></code>
method to the location specified. The response
+is told to redirect the browser to the specified location (a new request from
the client). The consequence of doing this
+means that the action (action instance, action errors, field errors, etc) that
was just executed is lost and no longer
+available. This is because actions are built on a single-thread model. The
only way to pass data is through the session
+or with web parameters (<code class="highlighter-rouge">url?name=value</code>)
which can be OGNL expressions.</p>
-<h3 id="parameters">Parameters</h3>
+<h2 id="parameters">Parameters</h2>
<ul>
- <li>
- <p><code class="highlighter-rouge">location</code> (default) - the
location to go to after execution.</p>
- </li>
- <li>
- <p><code class="highlighter-rouge">parse</code> - true by default. If set
to false, the location param will not be parsed for OGNL expressions.</p>
- </li>
- <li>
- <p><code class="highlighter-rouge">anchor</code> - Optional. Also known as
“fragment” or colloquially as “hash”. You can specify an anchor for a
result.</p>
- </li>
+ <li><code class="highlighter-rouge">location</code> (default) - the location
to go to after execution.</li>
+ <li><code class="highlighter-rouge">parse</code> - true by default. If set
to false, the location param will not be parsed for OGNL expressions.</li>
+ <li><code class="highlighter-rouge">anchor</code> - Optional. Also known as
“fragment” or colloquially as “hash”. You can specify an anchor for a
result.</li>
</ul>
-<p>This result follows the same rules from StrutsResultSupport.</p>
+<p>This result follows the same rules from <code
class="highlighter-rouge">StrutsResultSupport</code>.</p>
-<h3 id="examples">Examples</h3>
+<h2 id="examples">Examples</h2>
-<div class="highlighter-rouge"><pre class="highlight"><code><!--
+<div class="highlighter-rouge"><pre class="highlight"><code><span
class="c"><!--
The redirect URL generated will be:
/foo.jsp#FRAGMENT
--->
-<result name="success" type="redirect">
- <param name="location">foo.jsp</param>
- <param name="parse">false</param>
- <param name="anchor">FRAGMENT</param>
-</result>
+--></span>
+<span class="nt"><result</span> <span class="na">name=</span><span
class="s">"success"</span> <span class="na">type=</span><span
class="s">"redirect"</span><span class="nt">></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"location"</span><span class="nt">></span>foo.jsp<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"parse"</span><span class="nt">></span>false<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"anchor"</span><span class="nt">></span>FRAGMENT<span
class="nt"></param></span>
+<span class="nt"></result></span>
</code></pre>
</div>
-<div class="highlighter-rouge"><pre class="highlight"><code><package
name="passingRequestParameters" extends="struts-default"
namespace="/passingRequestParameters">
- <-- Pass parameters (reportType, width and height) -->
- <!--
+<div class="highlighter-rouge"><pre class="highlight"><code><span
class="nt"><package</span> <span class="na">name=</span><span
class="s">"passingRequestParameters"</span> <span
class="na">extends=</span><span class="s">"struts-default"</span> <span
class="na">namespace=</span><span
class="s">"/passingRequestParameters"</span><span class="nt">></span>
+ <span class="nt"><--</span> <span class="err">Pass</span> <span
class="err">parameters</span> <span class="err">(reportType,</span> <span
class="err">width</span> <span class="err">and</span> <span
class="err">height)</span> <span class="err">--</span><span
class="nt">></span>
+ <span class="c"><!--
The redirect url generated will be - the namespace of current acction will
be appended as location doesn't start with "/":
/passingRequestParameters/generateReport.jsp?reportType=pie&width=100&height=100#summary
- -->
- <action name="gatherReportInfo" class="...">
- <result name="showReportResult" type="redirect">
- <param name="location">generateReport.jsp</param>
- <param name="reportType">pie</param>
- <param name="width">100</param>
- <param name="height">100</param>
- <param name="parse">false</param>
- <param name="anchor">summary</param>
- </result>
- </action>
-</package>
+ --></span>
+ <span class="nt"><action</span> <span class="na">name=</span><span
class="s">"gatherReportInfo"</span> <span class="na">class=</span><span
class="s">"..."</span><span class="nt">></span>
+ <span class="nt"><result</span> <span class="na">name=</span><span
class="s">"showReportResult"</span> <span class="na">type=</span><span
class="s">"redirect"</span><span class="nt">></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"location"</span><span class="nt">></span>generateReport.jsp<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"reportType"</span><span class="nt">></span>pie<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"width"</span><span class="nt">></span>100<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"height"</span><span class="nt">></span>100<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"parse"</span><span class="nt">></span>false<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"anchor"</span><span class="nt">></span>summary<span
class="nt"></param></span>
+ <span class="nt"></result></span>
+ <span class="nt"></action></span>
+<span class="nt"></package></span>
</code></pre>
</div>
diff --git a/content/core-developers/result-types.html
b/content/core-developers/result-types.html
index 6e28c5f..bc18fe7 100644
--- a/content/core-developers/result-types.html
+++ b/content/core-developers/result-types.html
@@ -181,15 +181,19 @@ own applications.</p>
<td>Used to display the raw content of a particular page (i.e jsp,
HTML)</td>
</tr>
<tr>
- <td><a href="tiles-result.html">Tiles Result</a></td>
+ <td><a href="../plugins/tiles/">Tiles Result</a></td>
<td>Used to provide Tiles integration</td>
</tr>
<tr>
+ <td><a href="../plugins/tiles-3/">Tiles 3 Result</a></td>
+ <td>Used to provide Tiles 3 integration</td>
+ </tr>
+ <tr>
<td><a href="postback-result.html">Postback Result</a></td>
<td>Used to postback request parameters as a form to the specified
destination</td>
</tr>
<tr>
- <td><a href="json-result.html">JSON Result</a></td>
+ <td><a href="../plugins/json/">JSON Result</a></td>
<td>Used to serialize actions into JSON</td>
</tr>
</tbody>
diff --git a/content/core-developers/stream-result.html
b/content/core-developers/stream-result.html
index 19edf93..92cfd57 100644
--- a/content/core-developers/stream-result.html
+++ b/content/core-developers/stream-result.html
@@ -125,94 +125,105 @@
<article class="container">
<section class="col-md-12">
- <a href="index.html" title="back to Core Developers Guide"><< back to Core
Developers Guide</a>
<a class="edit-on-gh"
href="https://github.com/apache/struts-site/edit/master/source/core-developers/stream-result.md"
title="Edit this page on GitHub">Edit on GitHub</a>
+
+ <a href="index.html" title="back to Core Developer Guide"><< back to Core
Developer Guide</a>
+
<h1 id="stream-result">Stream Result</h1>
-<p>A custom Result type for sending raw data (via an InputStream) directly to
the HttpServletResponse. Very useful for allowing users to download content.
-If you are running your app server under HTTPS and having issues with PDF’s or
other file streams you should take a look at <a
href="https-and-ie-issues.html">HTTPS and IE Issues</a></p>
+<p>A custom Result type for sending raw data (via an InputStream) directly to
the HttpServletResponse. Very useful for
+allowing users to download content. If you are running your app server under
HTTPS and having issues with PDF’s or other
+file streams you should take a look at <a
href="https-and-ie-issues.html">HTTPS and IE Issues</a></p>
-<h3 id="parameters">Parameters</h3>
+<h2 id="parameters">Parameters</h2>
<ul>
- <li><code class="highlighter-rouge">contentType</code> - the stream
mime-type as sent to the web browser (default = text/plain).</li>
+ <li><code class="highlighter-rouge">contentType</code> - the stream
mime-type as sent to the web browser (default = <code
class="highlighter-rouge">text/plain</code>).</li>
<li><code class="highlighter-rouge">contentLength</code> - the stream length
in bytes (the browser displays a progress bar).</li>
- <li><code class="highlighter-rouge">contentDisposition</code> - the content
disposition header value for specifying the file name (default = inline, values
are typically attachment;filename=”document.pdf”.</li>
- <li><code class="highlighter-rouge">inputName</code> - the name of the
InputStream property from the chained action (default = inputStream).</li>
- <li><code class="highlighter-rouge">bufferSize</code> - the size of the
buffer to copy from input to output (default = 1024).</li>
- <li><code class="highlighter-rouge">allowCaching</code> - if set to ‘false’
it will set the headers <code class="highlighter-rouge">Pragma</code> and <code
class="highlighter-rouge">Cache-Control</code> to <code
class="highlighter-rouge">no-cahce</code>, and prevent client from caching the
content (default = true).</li>
- <li><code class="highlighter-rouge">contentCharSet</code> - if set to a
string, ‘;charset=value’ will be added to the content-type header, where value
is the string set. If set to an expression, the result of evaluating the
expression will be used. If not set, then no charset will be set on the
header</li>
+ <li><code class="highlighter-rouge">contentDisposition</code> - the content
disposition header value for specifying the file name (default = <code
class="highlighter-rouge">inline</code>, values
+are typically <code
class="highlighter-rouge">attachment;filename="document.pdf"</code>.</li>
+ <li><code class="highlighter-rouge">inputName</code> - the name of the
InputStream property from the chained action (default = <code
class="highlighter-rouge">inputStream</code>).</li>
+ <li><code class="highlighter-rouge">bufferSize</code> - the size of the
buffer to copy from input to output (default = <code
class="highlighter-rouge">1024</code>).</li>
+ <li><code class="highlighter-rouge">allowCaching</code> - if set to ‘false’
it will set the headers <code class="highlighter-rouge">Pragma</code> and <code
class="highlighter-rouge">Cache-Control</code> to <code
class="highlighter-rouge">no-cahce</code>, and prevent
+client from caching the content (default = <code
class="highlighter-rouge">true</code>).</li>
+ <li><code class="highlighter-rouge">contentCharSet</code> - if set to a
string, ‘;charset=value’ will be added to the content-type header, where value
is the string
+set. If set to an expression, the result of evaluating the expression will be
used. If not set, then no charset will
+be set on the header</li>
</ul>
-<p>These parameters can also be set by exposing a similarly named getter
method on your Action. For example, you can provide <code
class="highlighter-rouge">getContentType()</code> to override that parameter
for the current action. To do it you you must explicitly define this param as
an expression i.e. <code class="highlighter-rouge"><param
name="contentType">${contentType}</param></code></p>
+<p>These parameters can also be set by exposing a similarly named getter
method on your Action. For example, you can provide
+<code class="highlighter-rouge">getContentType()</code> to override that
parameter for the current action. To do it you you must explicitly define this
param
+as an expression i.e. <code class="highlighter-rouge"><param
name="contentType">${contentType}</param></code></p>
-<p>Please be aware that this was changed since Struts 2.5.2, previously each
parameter was automagically resolved by looking throughout the <code
class="highlighter-rouge">ValueStack</code>, now you must explicitly define
which parameter must be evaluated, even <code
class="highlighter-rouge">inputName</code>.</p>
+<p class="alert alert-success">Please be aware that this was changed since
Struts 2.5.2, previously each parameter was automatically resolved by looking
+throughout the <code class="highlighter-rouge">ValueStack</code>, now you must
explicitly define which parameter must be evaluated, even <code
class="highlighter-rouge">inputName</code>.</p>
-<h3 id="examples">Examples</h3>
+<h2 id="examples">Examples</h2>
-<h4 id="annotation-based-configuration">Annotation based Configuration</h4>
+<h3 id="annotation-based-configuration">Annotation based Configuration</h3>
-<p>To configure Actions and Results with Annotations you need to activate the
Struts2 <em>Convention Plugin</em> in your Struts2 application.</p>
+<p>To configure Actions and Results with Annotations you need to activate the
Struts2 <a href="../plugins/convention/">Convention Plugin</a>
+in your Struts2 application.</p>
-<div class="highlighter-rouge"><pre class="highlight"><code>package
com.mycompany.webapp.actions;
+<div class="highlighter-rouge"><pre class="highlight"><code><span
class="kn">package</span> <span class="n">com</span><span
class="o">.</span><span class="na">mycompany</span><span
class="o">.</span><span class="na">webapp</span><span class="o">.</span><span
class="na">actions</span><span class="o">;</span>
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
+<span class="kn">import</span> <span class="nn">java.io.File</span><span
class="o">;</span>
+<span class="kn">import</span> <span
class="nn">java.io.FileInputStream</span><span class="o">;</span>
+<span class="kn">import</span> <span
class="nn">java.io.InputStream</span><span class="o">;</span>
-import org.apache.struts2.convention.annotation.Result;
+<span class="kn">import</span> <span
class="nn">org.apache.struts2.convention.annotation.Result</span><span
class="o">;</span>
-import com.opensymphony.xwork2.Action;
-import com.opensymphony.xwork2.ActionSupport;
+<span class="kn">import</span> <span
class="nn">com.opensymphony.xwork2.Action</span><span class="o">;</span>
+<span class="kn">import</span> <span
class="nn">com.opensymphony.xwork2.ActionSupport</span><span class="o">;</span>
-@Result(
- name = "success",
- type = "stream",
- params = {
- "contentType", "${type}",
- "inputName", "${stream}",
- "bufferSize", "1024",
- "contentDisposition", "attachment;filename=\"${filename}\""
- }
-)
-public class FileDisplay extends ActionSupport {
+<span class="nd">@Result</span><span class="o">(</span>
+ <span class="n">name</span> <span class="o">=</span> <span
class="s">"success"</span><span class="o">,</span>
+ <span class="n">type</span> <span class="o">=</span> <span
class="s">"stream"</span><span class="o">,</span>
+ <span class="n">params</span> <span class="o">=</span> <span
class="o">{</span>
+ <span class="s">"contentType"</span><span class="o">,</span>
<span class="s">"${type}"</span><span class="o">,</span>
+ <span class="s">"inputName"</span><span class="o">,</span>
<span class="s">"${stream}"</span><span class="o">,</span>
+ <span class="s">"bufferSize"</span><span class="o">,</span>
<span class="s">"1024"</span><span class="o">,</span>
+ <span class="s">"contentDisposition"</span><span
class="o">,</span> <span class="s">"attachment;filename=\"${filename}\""</span>
+ <span class="o">}</span>
+<span class="o">)</span>
+<span class="kd">public</span> <span class="kd">class</span> <span
class="nc">FileDisplay</span> <span class="kd">extends</span> <span
class="n">ActionSupport</span> <span class="o">{</span>
- private String type = "image/jpeg";
- private String filename;
- private InputStream stream;
+ <span class="kd">private</span> <span class="n">String</span> <span
class="n">type</span> <span class="o">=</span> <span
class="s">"image/jpeg"</span><span class="o">;</span>
+ <span class="kd">private</span> <span class="n">String</span> <span
class="n">filename</span><span class="o">;</span>
+ <span class="kd">private</span> <span class="n">InputStream</span>
<span class="n">stream</span><span class="o">;</span>
- public String execute() throws Exception {
+ <span class="kd">public</span> <span class="n">String</span> <span
class="n">execute</span><span class="o">()</span> <span
class="kd">throws</span> <span class="n">Exception</span> <span
class="o">{</span>
- filename = "myimage.jpg";
- File img = new File("/path/to/image/image.jpg");
- stream = new FileInputStream(img);
+ <span class="n">filename</span> <span class="o">=</span> <span
class="s">"myimage.jpg"</span><span class="o">;</span>
+ <span class="n">File</span> <span class="n">img</span> <span
class="o">=</span> <span class="k">new</span> <span class="n">File</span><span
class="o">(</span><span class="s">"/path/to/image/image.jpg"</span><span
class="o">);</span>
+ <span class="n">stream</span> <span class="o">=</span> <span
class="k">new</span> <span class="n">FileInputStream</span><span
class="o">(</span><span class="n">img</span><span class="o">);</span>
- return Action.SUCCESS;
- }
+ <span class="k">return</span> <span
class="n">Action</span><span class="o">.</span><span
class="na">SUCCESS</span><span class="o">;</span>
+ <span class="o">}</span>
- private String getType() {
- return this.type;
- }
+ <span class="kd">private</span> <span class="n">String</span> <span
class="n">getType</span><span class="o">()</span> <span class="o">{</span>
+ <span class="k">return</span> <span class="k">this</span><span
class="o">.</span><span class="na">type</span><span class="o">;</span>
+ <span class="o">}</span>
- private String getFilename() {
- return this.filename;
- }
+ <span class="kd">private</span> <span class="n">String</span> <span
class="n">getFilename</span><span class="o">()</span> <span class="o">{</span>
+ <span class="k">return</span> <span class="k">this</span><span
class="o">.</span><span class="na">filename</span><span class="o">;</span>
+ <span class="o">}</span>
- private String getStream() {
- return this.stream;
- }
-}
+ <span class="kd">private</span> <span class="n">String</span> <span
class="n">getStream</span><span class="o">()</span> <span class="o">{</span>
+ <span class="k">return</span> <span class="k">this</span><span
class="o">.</span><span class="na">stream</span><span class="o">;</span>
+ <span class="o">}</span>
+<span class="o">}</span>
</code></pre>
</div>
-<h4 id="xml-based-configuration">XML based Configuration</h4>
+<h3 id="xml-based-configuration">XML based Configuration</h3>
-<div class="highlighter-rouge"><pre class="highlight"><code><result
name="success" type="stream">
- <param name="contentType">image/jpeg</param>
- <param name="inputName">${imageStream}</param>
- <param
name="contentDisposition">attachment;filename="document.pdf"</param>
- <param name="bufferSize">1024</param>
-</result>
+<div class="highlighter-rouge"><pre class="highlight"><code><span
class="nt"><result</span> <span class="na">name=</span><span
class="s">"success"</span> <span class="na">type=</span><span
class="s">"stream"</span><span class="nt">></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"contentType"</span><span class="nt">></span>image/jpeg<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"inputName"</span><span class="nt">></span>${imageStream}<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"contentDisposition"</span><span
class="nt">></span>attachment;filename="document.pdf"<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"bufferSize"</span><span class="nt">></span>1024<span
class="nt"></param></span>
+<span class="nt"></result></span>
</code></pre>
</div>
diff --git a/content/core-developers/xsl-result.html
b/content/core-developers/xsl-result.html
index 670f745..75d1e5b 100644
--- a/content/core-developers/xsl-result.html
+++ b/content/core-developers/xsl-result.html
@@ -125,26 +125,32 @@
<article class="container">
<section class="col-md-12">
- <a href="index.html" title="back to Core Developers Guide"><< back to Core
Developers Guide</a>
<a class="edit-on-gh"
href="https://github.com/apache/struts-site/edit/master/source/core-developers/xsl-result.md"
title="Edit this page on GitHub">Edit on GitHub</a>
+
+ <a href="index.html" title="back to Core Developer Guide"><< back to Core
Developer Guide</a>
+
<h1 id="xsl-result">XSL Result</h1>
-<p>####Description####</p>
+<h2 id="description">Description</h2>
-<p>XSLTResult uses XSLT to transform an action object to XML. The recent
version has been specifically modified to deal with Xalan flaws. When using
Xalan you may notice that even though you have a very minimal stylesheet like
this one</p>
+<p>XSLTResult uses XSLT to transform an action object to XML. The recent
version has been specifically modified to deal
+with Xalan flaws. When using Xalan you may notice that even though you have a
very minimal stylesheet like this one</p>
-<div class="highlighter-rouge"><pre class="highlight"><code><xsl:template
match="/result">
-<result/>
-</xsl:template>
+<div class="highlighter-rouge"><pre class="highlight"><code><span
class="nt"><xsl:template</span> <span class="na">match=</span><span
class="s">"/result"</span><span class="nt">></span>
+<span class="nt"><result/></span>
+<span class="nt"></xsl:template></span>
</code></pre>
</div>
<p>Xalan would still iterate through every property of your action and all its
descendants.</p>
-<p>If you had double-linked objects, Xalan would work forever analysing an
infinite object tree. Even if your stylesheet was not constructed to process
them all. It’s because the current Xalan eagerly and extensively converts
-everything to its internal DTM model before further processing.</p>
+<p>If you had double-linked objects, Xalan would work forever analysing an
infinite object tree. Even if your stylesheet
+was not constructed to process them all. It’s because the current Xalan
eagerly and extensively converts everything
+to its internal DTM model before further processing.</p>
-<p>That’s why there’s a loop eliminator added that works by indexing every
object-property combination during processing. If it notices that some object’s
property was already walked through, it doesn’t go any deeper. Say you have two
objects, x and y, with the following properties set (pseudocode):</p>
+<p>That’s why there’s a loop eliminator added that works by indexing every
object-property combination during processing.
+If it notices that some object’s property was already walked through, it
doesn’t go any deeper. Say you have two objects,
+x and y, with the following properties set (pseudocode):</p>
<div class="highlighter-rouge"><pre class="highlight"><code>x.y = y;
and
@@ -155,69 +161,42 @@ action.x=x;
<p>Due to that modification, the resulting XML document based on x would
be:</p>
-<div class="highlighter-rouge"><pre class="highlight"><code><result>
-<x>
-<y/>
-</x>
-</result>
-</code></pre>
-</div>
-
-<p>Without it there would be endless</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>x/y/x/y/x/y/...
-</code></pre>
-</div>
-<p> elements.</p>
-
-<p>The</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>XSLTResult
-</code></pre>
-</div>
-<p> code tries also to deal with the fact that DTM model is built in a manner
that children are processed before siblings. The result is that if there is
object x that is both set in action’s x property, and very deeply under
action’s a property then it would only appear under a, not under x. That’s not
what we expect, and that’s why</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>XSLTResult
-</code></pre>
-</div>
-<p> allows objects to repeat in various places to some extent.</p>
-
-<p>Sometimes the object mesh is still very dense and you may notice that even
though you have a relatively simple stylesheet, execution takes a tremendous
amount of time. To help you to deal with that obstacle of Xalan, you may attach
regexp filters to elements paths (xpath).</p>
-
-<table>
- <tbody>
- <tr>
- <td>In your .xsl file the root match must be named
<strong>result</strong>. This example will output the username by using
<strong>getUsername</strong> on your action class:</td>
- </tr>
- </tbody>
-</table>
-
-<p>| <xsl:template match=”result”>
- <html>
- <body>
- Hello <xsl:value-of select=”username”/> how are you?
- </body>
- </html>
- </xsl:template></p>
-
-<p>In the following example the XSLT result would only walk through action’s
properties without their childs. It would also skip every property that has</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>hugeCollection
-</code></pre>
-</div>
-<p> in their name. Element’s path is first compared to</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>excludingPattern
-</code></pre>
-</div>
-<p> - if it matches it’s no longer processed. Then it is compared to</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>matchingPattern
+<div class="highlighter-rouge"><pre class="highlight"><code><span
class="nt"><result></span>
+<span class="nt"><x></span>
+<span class="nt"><y/></span>
+<span class="nt"></x></span>
+<span class="nt"></result></span>
</code></pre>
</div>
-<p> and processed only if there’s a match.</p>
-<div class="highlighter-rouge"><pre class="highlight"><code><result
name="success" type="xslt">
+<p>Without it there would be endless <code
class="highlighter-rouge">x/y/x/y/x/y/...</code> elements. The <code
class="highlighter-rouge">XSLTResult</code> code tries also to deal with the
fact
+that DTM model is built in a manner that children are processed before
siblings. The result is that if there is object
+<code class="highlighter-rouge">x</code> that is both set in action’s <code
class="highlighter-rouge">x</code> property, and very deeply under action’s a
property then it would only appear under
+<code class="highlighter-rouge">a</code>, not under <code
class="highlighter-rouge">x</code>. That’s not what we expect, and that’s why
<code class="highlighter-rouge">XSLTResult</code> allows objects to repeat in
various places
+to some extent.</p>
+
+<p>Sometimes the object mesh is still very dense and you may notice that even
though you have a relatively simple stylesheet,
+execution takes a tremendous amount of time. To help you to deal with that
obstacle of Xalan, you may attach regexp filters
+to elements paths (xpath).</p>
+
+<blockquote>
+ <p>In your .xsl file the root match must be named <code
class="highlighter-rouge">result</code>. This example will output the username
by using <code class="highlighter-rouge">getUsername</code> on your action
class:
+```xml</p>
+</blockquote>
+<xsl:template match="result">
+ <html>
+ <body>
+ Hello <xsl:value-of select="username" /> how are you?
+ </body>
+ </html>
+</xsl:template>
+<div class="highlighter-rouge"><pre class="highlight"><code>
+In the following example the XSLT result would only walk through action's
properties without their childs. It would also
+skip every property that has `hugeCollection` in their name. Element's path is
first compared to `excludingPattern` -
+if it matches it's no longer processed. Then it is compared to
`matchingPattern` and processed only if there's a match.
+
+```xml
+<result name="success" type="xslt">
<param name="stylesheetLocation">foo.xslt</param>
<param name="matchingPattern">^/result/[^/*]$</param>
<param name="excludingPattern">.*(hugeCollection).*</param>
@@ -225,79 +204,41 @@ action.x=x;
</code></pre>
</div>
-<p>In the following example the XSLT result would use the action’s user
property instead of the action as it’s base document and walk through it’s
properties. The</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>exposedValue
-</code></pre>
-</div>
-<p> uses an OGNL expression to derive it’s value.</p>
+<p>In the following example the XSLT result would use the action’s user
property instead of the action as it’s base document
+and walk through it’s properties. The <code
class="highlighter-rouge">exposedValue</code> uses an OGNL expression to derive
it’s value.</p>
-<div class="highlighter-rouge"><pre class="highlight"><code><result
name="success" type="xslt">
- <param name="stylesheetLocation">foo.xslt</param>
- <param name="exposedValue">${user}</param>
-</result>
+<div class="highlighter-rouge"><pre class="highlight"><code><span
class="nt"><result</span> <span class="na">name=</span><span
class="s">"success"</span> <span class="na">type=</span><span
class="s">"xslt"</span><span class="nt">></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"stylesheetLocation"</span><span class="nt">></span>foo.xslt<span
class="nt"></param></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"exposedValue"</span><span class="nt">></span>${user}<span
class="nt"></param></span>
+<span class="nt"></result></span>
</code></pre>
</div>
-<p>####Parameters####</p>
+<h2 id="parameters">Parameters</h2>
<p>This result type takes the following parameters:</p>
<ul>
- <li>
- <p><strong>stylesheetLocation</strong> (default) - the location to go to
after execution.</p>
- </li>
- <li>
- <p><strong>location</strong> (deprecated) - the same as
<strong>stylesheetLocation</strong> but it was dropped since Struts 2.5.</p>
- </li>
- <li>
- <p><strong>encoding </strong>- character encoding used in XML, default
UTF-8.</p>
- </li>
- <li>
- <p><strong>parse</strong> -</p>
- </li>
-</ul>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>true
-</code></pre>
-</div>
-<p> by default. If set to false, the location param will not be parsed for
Ognl expressions.</p>
-
-<ul>
- <li><strong>matchingPattern </strong>-</li>
+ <li><code class="highlighter-rouge">stylesheetLocation</code> (default) -
the location to go to after execution.</li>
+ <li><code class="highlighter-rouge">location</code> (deprecated) - the same
as <code class="highlighter-rouge">stylesheetLocation</code> but it was dropped
since Struts 2.5.</li>
+ <li><code class="highlighter-rouge">encoding</code> - character encoding
used in XML, default UTF-8.</li>
+ <li><code class="highlighter-rouge">parse</code> - <code
class="highlighter-rouge">true</code> by default. If set to false, the location
param will not be parsed for Ognl expressions.</li>
+ <li><code class="highlighter-rouge">matchingPattern</code> - a <code
class="highlighter-rouge">Pattern</code> that matches only desired elements, by
default it matches everything.</li>
+ <li><code class="highlighter-rouge">excludingPattern</code> - a <code
class="highlighter-rouge">Pattern</code> that eliminates unwanted elements, by
default it matches none.</li>
</ul>
-<div class="highlighter-rouge"><pre class="highlight"><code>Pattern
-</code></pre>
-</div>
-<p> that matches only desired elements, by default it matches everything.</p>
-
-<ul>
- <li><strong>excludingPattern</strong> -</li>
-</ul>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>Pattern
-</code></pre>
-</div>
-<p> that eliminates unwanted elements, by default it matches none.</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>struts.properties
-</code></pre>
-</div>
-<p> related configuration:</p>
+<p><code class="highlighter-rouge">struts.xml</code> related configuration:</p>
<ul>
- <li><strong>struts.xslt.nocache</strong> - Defaults to false. If set to
true, disables stylesheet caching. Good for development, bad for
production.</li>
+ <li><code class="highlighter-rouge">struts.xslt.nocache</code> - Defaults to
<code class="highlighter-rouge">false</code>. If set to true, disables
stylesheet caching. Good for development, bad for production.</li>
</ul>
-<p>####Examples####</p>
+<h2 id="examples">Examples</h2>
-<div class="highlighter-rouge"><pre class="highlight"><code><result
name="success" type="xslt">foo.xslt</result>
+<div class="highlighter-rouge"><pre class="highlight"><code><span
class="nt"><result</span> <span class="na">name=</span><span
class="s">"success"</span> <span class="na">type=</span><span
class="s">"xslt"</span><span class="nt">></span>foo.xslt<span
class="nt"></result></span>
</code></pre>
</div>
-<p> </p>
-
</section>
</article>
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].