This is an automated email from the ASF dual-hosted git repository.
git-site-role pushed a commit to branch asf-staging
in repository https://gitbox.apache.org/repos/asf/struts-site.git
The following commit(s) were added to refs/heads/asf-staging by this push:
new 820a53c18 Updates stage by Jenkins
820a53c18 is described below
commit 820a53c18ef125364faf11162ab8f995728757c6
Author: jenkins <[email protected]>
AuthorDate: Wed Jan 10 07:58:30 2024 +0000
Updates stage by Jenkins
---
...or.html => action-file-upload-interceptor.html} | 77 ++++----
.../core-developers/file-upload-interceptor.html | 6 +-
content/core-developers/file-upload.html | 49 +++++-
content/core-developers/interceptors.html | 194 +++++++++++----------
content/download.html | 2 +-
5 files changed, 182 insertions(+), 146 deletions(-)
diff --git a/content/core-developers/file-upload-interceptor.html
b/content/core-developers/action-file-upload-interceptor.html
similarity index 77%
copy from content/core-developers/file-upload-interceptor.html
copy to content/core-developers/action-file-upload-interceptor.html
index 800fd990d..1c99c5b98 100644
--- a/content/core-developers/file-upload-interceptor.html
+++ b/content/core-developers/action-file-upload-interceptor.html
@@ -7,7 +7,7 @@
<meta http-equiv="Content-Language" content="en"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <title>File Upload Interceptor</title>
+ <title>Action File Upload Interceptor</title>
<link
href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,400italic,600italic,700italic"
rel="stylesheet" type="text/css">
<link
href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css"
rel="stylesheet">
@@ -146,25 +146,21 @@
<article class="container">
<section class="col-md-12">
- <a class="edit-on-gh"
href="https://github.com/apache/struts-site/edit/master/source/core-developers/file-upload-interceptor.md"
title="Edit this page on GitHub">Edit on GitHub</a>
+ <a class="edit-on-gh"
href="https://github.com/apache/struts-site/edit/master/source/core-developers/action-file-upload-interceptor.md"
title="Edit this page on GitHub">Edit on GitHub</a>
- <a href="interceptors.html" title="back to Interceptors"><< back to
Interceptors</a>
+ <a href="interceptors" title="back to Interceptors"><< back to
Interceptors</a>
- <h1 id="file-upload-interceptor">File Upload Interceptor</h1>
+ <h1 id="action-file-upload-interceptor">Action File Upload Interceptor</h1>
+
+<blockquote>
+ <p>Available since Struts 6.4.0 as replacement for <a
href="file-upload-interceptor">File Upload Interceptor</a></p>
+</blockquote>
<p>See <a href="file-upload">this page</a> for more examples and advanced
configuration.</p>
<p>Interceptor that is based off of <code class="language-plaintext
highlighter-rouge">MultiPartRequestWrapper</code>, which is automatically
applied for any request that includes
-a file. It adds the following parameters, where <code
class="language-plaintext highlighter-rouge"><file name></code> is the
name given to the file uploaded by the HTML form:</p>
-
-<ul>
- <li><code class="language-plaintext highlighter-rouge"><file
name></code>: <code class="language-plaintext highlighter-rouge">File</code>
- the actual File</li>
- <li><code class="language-plaintext highlighter-rouge"><file
name>ContentType</code>: <code class="language-plaintext
highlighter-rouge">String</code> - the content type of the file</li>
- <li><code class="language-plaintext highlighter-rouge"><file
name>FileName</code>: <code class="language-plaintext
highlighter-rouge">String</code> - the actual name of the file uploaded (not
the HTML name)</li>
-</ul>
-
-<p>You can get access to these files by merely providing setters in your
action that correspond to any of the three patterns
-above, such as <code class="language-plaintext
highlighter-rouge">setDocument(File document)</code>, <code
class="language-plaintext highlighter-rouge">setDocumentContentType(String
contentType)</code>, etc.</p>
+a file. If an action implements <code class="language-plaintext
highlighter-rouge">org.apache.struts2.action.UploadedFilesAware</code>
interface, the interceptor will pass
+information and content of uploaded files using the callback method <code
class="language-plaintext
highlighter-rouge">withUploadedFiles(List<UploadedFile>)</code>.</p>
<p>See the example code section.</p>
@@ -203,7 +199,7 @@ and which are not.</p>
<p><strong>Example action mapping:</strong></p>
<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code> <span class="nt"><action</span> <span
class="na">name=</span><span class="s">"doUpload"</span> <span
class="na">class=</span><span class="s">"com.example.UploadAction"</span><span
class="nt">></span>
- <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"fileUpload"</span><span
class="nt">/></span>
+ <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"actionFileUpload"</span><span
class="nt">/></span>
<span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"basicStack"</span><span
class="nt">/></span>
<span class="nt"><result</span> <span class="na">name=</span><span
class="s">"success"</span><span class="nt">></span>good_result.jsp<span
class="nt"></result></span>
<span class="nt"></action></span>
@@ -225,34 +221,27 @@ and which are not.</p>
<p><strong>Example Action class:</strong></p>
-<div class="language-java highlighter-rouge"><div class="highlight"><pre
class="highlight"><code> <span class="kn">package</span> <span
class="nn">com.example</span><span class="o">;</span>
-
- <span class="kn">import</span> <span class="nn">java.io.File</span><span
class="o">;</span>
- <span class="kn">import</span> <span
class="nn">com.opensymphony.xwork2.ActionSupport</span><span class="o">;</span>
-
- <span class="kd">public</span> <span class="nc">UploadAction</span> <span
class="kd">extends</span> <span class="nc">ActionSupport</span> <span
class="o">{</span>
- <span class="kd">private</span> <span class="nc">File</span> <span
class="n">file</span><span class="o">;</span>
- <span class="kd">private</span> <span class="nc">String</span> <span
class="n">contentType</span><span class="o">;</span>
- <span class="kd">private</span> <span class="nc">String</span> <span
class="n">filename</span><span class="o">;</span>
-
- <span class="kd">public</span> <span class="kt">void</span> <span
class="nf">setUpload</span><span class="o">(</span><span class="nc">File</span>
<span class="n">file</span><span class="o">)</span> <span class="o">{</span>
- <span class="k">this</span><span class="o">.</span><span
class="na">file</span> <span class="o">=</span> <span
class="n">file</span><span class="o">;</span>
- <span class="o">}</span>
-
- <span class="kd">public</span> <span class="kt">void</span> <span
class="nf">setUploadContentType</span><span class="o">(</span><span
class="nc">String</span> <span class="n">contentType</span><span
class="o">)</span> <span class="o">{</span>
- <span class="k">this</span><span class="o">.</span><span
class="na">contentType</span> <span class="o">=</span> <span
class="n">contentType</span><span class="o">;</span>
- <span class="o">}</span>
-
- <span class="kd">public</span> <span class="kt">void</span> <span
class="nf">setUploadFileName</span><span class="o">(</span><span
class="nc">String</span> <span class="n">filename</span><span
class="o">)</span> <span class="o">{</span>
- <span class="k">this</span><span class="o">.</span><span
class="na">filename</span> <span class="o">=</span> <span
class="n">filename</span><span class="o">;</span>
- <span class="o">}</span>
-
- <span class="kd">public</span> <span class="nc">String</span> <span
class="nf">execute</span><span class="o">()</span> <span class="o">{</span>
- <span class="c1">//...</span>
- <span class="k">return</span> <span class="no">SUCCESS</span><span
class="o">;</span>
- <span class="o">}</span>
- <span class="o">}</span>
-
+<div class="language-java highlighter-rouge"><div class="highlight"><pre
class="highlight"><code><span class="kd">public</span> <span
class="kd">class</span> <span class="nc">UploadAction</span> <span
class="kd">extends</span> <span class="nc">ActionSupport</span> <span
class="kd">implements</span> <span class="nc">UploadedFilesAware</span> <span
class="o">{</span>
+ <span class="kd">private</span> <span class="nc">UploadedFile</span> <span
class="n">uploadedFile</span><span class="o">;</span>
+ <span class="kd">private</span> <span class="nc">String</span> <span
class="n">contentType</span><span class="o">;</span>
+ <span class="kd">private</span> <span class="nc">String</span> <span
class="n">fileName</span><span class="o">;</span>
+ <span class="kd">private</span> <span class="nc">String</span> <span
class="n">originalName</span><span class="o">;</span>
+
+ <span class="nd">@Override</span>
+ <span class="kd">public</span> <span class="kt">void</span> <span
class="nf">withUploadedFiles</span><span class="o">(</span><span
class="nc">List</span><span class="o"><</span><span
class="nc">UploadedFile</span><span class="o">></span> <span
class="n">uploadedFiles</span><span class="o">)</span> <span class="o">{</span>
+ <span class="k">if</span> <span class="o">(!</span><span
class="n">uploadedFiles</span><span class="o">.</span><span
class="na">isEmpty</span><span class="o">()</span> <span class="o">></span>
<span class="mi">0</span><span class="o">)</span> <span class="o">{</span>
+ <span class="k">this</span><span class="o">.</span><span
class="na">uploadedFile</span> <span class="o">=</span> <span
class="n">uploadedFiles</span><span class="o">.</span><span
class="na">get</span><span class="o">(</span><span class="mi">0</span><span
class="o">);</span>
+ <span class="k">this</span><span class="o">.</span><span
class="na">fileName</span> <span class="o">=</span> <span
class="n">uploadedFile</span><span class="o">.</span><span
class="na">getName</span><span class="o">();</span>
+ <span class="k">this</span><span class="o">.</span><span
class="na">contentType</span> <span class="o">=</span> <span
class="n">uploadedFile</span><span class="o">.</span><span
class="na">getContentType</span><span class="o">();</span>
+ <span class="k">this</span><span class="o">.</span><span
class="na">originalName</span> <span class="o">=</span> <span
class="n">uploadedFile</span><span class="o">.</span><span
class="na">getOriginalName</span><span class="o">();</span>
+ <span class="o">}</span>
+ <span class="o">}</span>
+
+ <span class="kd">public</span> <span class="nc">String</span> <span
class="nf">execute</span><span class="o">()</span> <span class="o">{</span>
+ <span class="c1">//do something with the file</span>
+ <span class="k">return</span> <span class="no">SUCCESS</span><span
class="o">;</span>
+ <span class="o">}</span>
+<span class="o">}</span>
</code></pre></div></div>
<p><strong>Setting parameters example:</strong></p>
@@ -264,7 +253,7 @@ and which are not.</p>
<span class="nt"></interceptor-ref></span>
</code></pre></div></div>
-<p>This part is optional and would be done in place of the <code
class="language-plaintext highlighter-rouge"><interceptor-ref
name="fileUpload"/></code> line in the action mapping
+<p>This part is optional and would be done in place of the <code
class="language-plaintext highlighter-rouge"><interceptor-ref
name="actionFileUpload"/></code> line in the action mapping
example above.</p>
</section>
diff --git a/content/core-developers/file-upload-interceptor.html
b/content/core-developers/file-upload-interceptor.html
index 800fd990d..514c6ede1 100644
--- a/content/core-developers/file-upload-interceptor.html
+++ b/content/core-developers/file-upload-interceptor.html
@@ -148,10 +148,14 @@
<section class="col-md-12">
<a class="edit-on-gh"
href="https://github.com/apache/struts-site/edit/master/source/core-developers/file-upload-interceptor.md"
title="Edit this page on GitHub">Edit on GitHub</a>
- <a href="interceptors.html" title="back to Interceptors"><< back to
Interceptors</a>
+ <a href="interceptors" title="back to Interceptors"><< back to
Interceptors</a>
<h1 id="file-upload-interceptor">File Upload Interceptor</h1>
+<blockquote>
+ <p>Since Struts 6.4.0 this interceptor is deprecated, please use Action
FileUpload Interceptor instead!</p>
+</blockquote>
+
<p>See <a href="file-upload">this page</a> for more examples and advanced
configuration.</p>
<p>Interceptor that is based off of <code class="language-plaintext
highlighter-rouge">MultiPartRequestWrapper</code>, which is automatically
applied for any request that includes
diff --git a/content/core-developers/file-upload.html
b/content/core-developers/file-upload.html
index 07e3232e9..9438fb836 100644
--- a/content/core-developers/file-upload.html
+++ b/content/core-developers/file-upload.html
@@ -189,11 +189,15 @@ than the temporary directory and the directories that
belong to your web applica
<p>The Struts 2 framework leverages the Commons FileUpload library as a based
library to support file upload in the framework.
The library is included in a base Struts 2 distribution.</p>
+<blockquote>
+ <p>NOTE: Since Struts 6.4.0 the <code class="language-plaintext
highlighter-rouge">FileUploadInterceptor</code> is deprecated and you should
use <code class="language-plaintext
highlighter-rouge">ActionFileUploadInterceptor</code> instead!</p>
+</blockquote>
+
<h2 id="basic-usage">Basic Usage</h2>
-<p>The <code class="language-plaintext
highlighter-rouge">org.apache.struts2.interceptor.FileUploadInterceptor</code>
class is included as part of the <code class="language-plaintext
highlighter-rouge">defaultStack</code>. As long as
-the required libraries are added to your project you will be able to take
advantage of the Struts 2 file upload
-capability. Configure an Action mapping for your Action class as you typically
would.</p>
+<p>The <code class="language-plaintext
highlighter-rouge">org.apache.struts2.interceptor.FileUploadInterceptor</code>
and <code class="language-plaintext
highlighter-rouge">org.apache.struts2.interceptor.ActionFileUploadInterceptor</code>
+classes is included as part of the <code class="language-plaintext
highlighter-rouge">defaultStack</code>. As long as the required libraries are
added to your project you will be able
+to take advantage of the Struts 2 file upload capability. Configure an Action
mapping for your Action class as you typically would.</p>
<h3 id="example-action-mapping">Example action mapping:</h3>
@@ -203,9 +207,8 @@ capability. Configure an Action mapping for your Action
class as you typically w
</code></pre></div></div>
-<p>A form must be create with a form field of type file, <code
class="language-plaintext highlighter-rouge"><INPUT type="file"
name="upload"></code>. The form used to upload the
-file must have its encoding type set
-to <code class="language-plaintext
highlighter-rouge">multipart/form-data</code>, <code class="language-plaintext
highlighter-rouge"><form action="doUpload" enctype="multipart/form-data"
method="post"></code>.
+<p>A form must be created with a form field of type file, <code
class="language-plaintext highlighter-rouge"><INPUT type="file"
name="upload"></code>. The form used to upload the
+file must have its encoding type set to <code class="language-plaintext
highlighter-rouge">multipart/form-data</code>, <code class="language-plaintext
highlighter-rouge"><form action="doUpload" enctype="multipart/form-data"
method="post"></code>.
The standard procedure for adding these elements is by using the Struts 2 tag
libraries as shown in the following
example:</p>
@@ -217,7 +220,34 @@ example:</p>
<span class="nt"></s:form></span>
</code></pre></div></div>
-<p>The fileUpload interceptor will use setter injection to insert the uploaded
file and related data into your Action
+<p>The actionFileUpload interceptor will use a dedicated interface <code
class="language-plaintext
highlighter-rouge">org.apache.struts2.action.UploadedFilesAware</code> to
transfer
+information and content of uploaded file. Your action should implement the
interface to receive the uploaded file:</p>
+
+<div class="language-java highlighter-rouge"><div class="highlight"><pre
class="highlight"><code><span class="kd">public</span> <span
class="kd">class</span> <span class="nc">UploadAction</span> <span
class="kd">extends</span> <span class="nc">ActionSupport</span> <span
class="kd">implements</span> <span class="nc">UploadedFilesAware</span> <span
class="o">{</span>
+
+ <span class="kd">private</span> <span class="nc">UploadedFile</span> <span
class="n">uploadedFile</span><span class="o">;</span>
+ <span class="kd">private</span> <span class="nc">String</span> <span
class="n">contentType</span><span class="o">;</span>
+ <span class="kd">private</span> <span class="nc">String</span> <span
class="n">fileName</span><span class="o">;</span>
+ <span class="kd">private</span> <span class="nc">String</span> <span
class="n">originalName</span><span class="o">;</span>
+
+ <span class="nd">@Override</span>
+ <span class="kd">public</span> <span class="kt">void</span> <span
class="nf">withUploadedFiles</span><span class="o">(</span><span
class="nc">List</span><span class="o"><</span><span
class="nc">UploadedFile</span><span class="o">></span> <span
class="n">uploadedFiles</span><span class="o">)</span> <span class="o">{</span>
+ <span class="k">if</span> <span class="o">(!</span><span
class="n">uploadedFiles</span><span class="o">.</span><span
class="na">isEmpty</span><span class="o">()</span> <span class="o">></span>
<span class="mi">0</span><span class="o">)</span> <span class="o">{</span>
+ <span class="k">this</span><span class="o">.</span><span
class="na">uploadedFile</span> <span class="o">=</span> <span
class="n">uploadedFiles</span><span class="o">.</span><span
class="na">get</span><span class="o">(</span><span class="mi">0</span><span
class="o">);</span>
+ <span class="k">this</span><span class="o">.</span><span
class="na">fileName</span> <span class="o">=</span> <span
class="n">uploadedFile</span><span class="o">.</span><span
class="na">getName</span><span class="o">();</span>
+ <span class="k">this</span><span class="o">.</span><span
class="na">contentType</span> <span class="o">=</span> <span
class="n">uploadedFile</span><span class="o">.</span><span
class="na">getContentType</span><span class="o">();</span>
+ <span class="k">this</span><span class="o">.</span><span
class="na">originalName</span> <span class="o">=</span> <span
class="n">uploadedFile</span><span class="o">.</span><span
class="na">getOriginalName</span><span class="o">();</span>
+ <span class="o">}</span>
+ <span class="o">}</span>
+
+ <span class="kd">public</span> <span class="nc">String</span> <span
class="nf">execute</span><span class="o">()</span> <span class="o">{</span>
+ <span class="c1">// do something with the file</span>
+ <span class="k">return</span> <span class="no">SUCCESS</span><span
class="o">;</span>
+ <span class="o">}</span>
+<span class="o">}</span>
+</code></pre></div></div>
+
+<p><strong>Deprecated approach</strong>: the fileUpload interceptor will use
setter injection to insert the uploaded file and related data into your Action
class. For a form field named <code class="language-plaintext
highlighter-rouge">upload</code> you would provide the three setter methods
shown in the following example:</p>
<h3 id="example-action-class">Example Action class:</h3>
@@ -300,7 +330,10 @@ see <code class="language-plaintext
highlighter-rouge">struts-fileupload.xml</co
<span class="nt"></s:form></span>
</code></pre></div></div>
-<p><code class="language-plaintext
highlighter-rouge">MultipleFileUploadUsingArrayAction.java</code></p>
+<p>The <code class="language-plaintext
highlighter-rouge">org.apache.struts2.action.UploadedFilesAware</code>
interface already supports uploading multiple files, you do not need to
+follow the below example.</p>
+
+<p><strong>Deprecated approach</strong>: <code class="language-plaintext
highlighter-rouge">MultipleFileUploadUsingArrayAction.java</code></p>
<div class="language-java highlighter-rouge"><div class="highlight"><pre
class="highlight"><code><span class="kd">public</span> <span
class="kd">class</span> <span
class="nc">MultipleFileUploadUsingArrayAction</span> <span
class="kd">extends</span> <span class="nc">ActionSupport</span> <span
class="o">{</span>
<span class="kd">private</span> <span class="nc">File</span><span
class="o">[]</span> <span class="n">uploads</span><span class="o">;</span>
diff --git a/content/core-developers/interceptors.html
b/content/core-developers/interceptors.html
index ccb418e1e..b1750029b 100644
--- a/content/core-developers/interceptors.html
+++ b/content/core-developers/interceptors.html
@@ -146,98 +146,92 @@
<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/interceptors.md"
title="Edit this page on GitHub">Edit on GitHub</a>
+
+ <a href="index" title="back to Core Developers Guide"><< back to Core
Developers Guide</a>
+
<h1 class="no_toc" id="interceptors">Interceptors</h1>
-<ul id="markdown-toc">
- <li><a href="#understanding-interceptors"
id="markdown-toc-understanding-interceptors">Understanding Interceptors</a></li>
- <li><a href="#configuring-interceptors"
id="markdown-toc-configuring-interceptors">Configuring Interceptors</a></li>
- <li><a href="#stacking-interceptors"
id="markdown-toc-stacking-interceptors">Stacking Interceptors</a></li>
- <li><a href="#the-default-configuration"
id="markdown-toc-the-default-configuration">The Default Configuration</a></li>
- <li><a href="#framework-interceptors"
id="markdown-toc-framework-interceptors">Framework Interceptors</a></li>
- <li><a href="#method-filtering" id="markdown-toc-method-filtering">Method
Filtering</a></li>
- <li><a href="#interceptor-parameter-overriding"
id="markdown-toc-interceptor-parameter-overriding">Interceptor Parameter
Overriding</a></li>
- <li><a href="#interceptor-parameter-overriding-inheritance"
id="markdown-toc-interceptor-parameter-overriding-inheritance">Interceptor
Parameter Overriding Inheritance</a></li>
- <li><a href="#lazy-parameters" id="markdown-toc-lazy-parameters">Lazy
parameters</a></li>
- <li><a href="#disabling-interceptor"
id="markdown-toc-disabling-interceptor">Disabling interceptor</a></li>
- <li><a href="#order-of-interceptor-execution"
id="markdown-toc-order-of-interceptor-execution">Order of Interceptor
Execution</a></li>
+<ul>
+ <li>Will be replaced with the ToC, excluding a header</li>
</ul>
-<p>The default Interceptor stack is designed to serve the needs of most
applications. Most applications will <strong>not</strong> need
+<p>The default Interceptor stack is designed to serve the needs of most
applications. Most applications will <strong>not</strong> need
to add Interceptors or change the Interceptor stack.</p>
-<p>Many Actions share common concerns. Some Actions need input validated.
Other Actions may need a file upload
-to be pre-processed. Another Action might need protection from a double
submit. Many Actions need drop-down lists
+<p>Many Actions share common concerns. Some Actions need input validated.
Other Actions may need a file upload
+to be pre-processed. Another Action might need protection from a double
submit. Many Actions need drop-down lists
and other controls pre-populated before the page displays.</p>
-<p>The framework makes it easy to share solutions to these concerns using an
“Interceptor” strategy. When you request
-a resource that maps to an “action”, the framework invokes the Action object.
But, before the Action is executed,
-the invocation can be intercepted by another object. After the Action
executes, the invocation could be intercepted
+<p>The framework makes it easy to share solutions to these concerns using an
“Interceptor” strategy. When you request
+a resource that maps to an “action”, the framework invokes the Action object.
But, before the Action is executed,
+the invocation can be intercepted by another object. After the Action
executes, the invocation could be intercepted
again. Unsurprisingly, we call these objects “Interceptors.”</p>
<h2 id="understanding-interceptors">Understanding Interceptors</h2>
-<p>Interceptors can execute code before and after an Action is invoked. Most
of the framework’s core functionality is
-implemented as Interceptors. Features like double-submit guards, type
conversion, object population, validation,
-file upload, page preparation, and more, are all implemented with the help of
Interceptors. Each and every Interceptor
+<p>Interceptors can execute code before and after an Action is invoked. Most
of the framework’s core functionality is
+implemented as Interceptors. Features like double-submit guards, type
conversion, object population, validation,
+file upload, page preparation, and more, are all implemented with the help of
Interceptors. Each and every Interceptor
is pluggable, so you can decide exactly which features an Action needs to
support.</p>
-<p>Interceptors can be configured on a per-action basis. Your own custom
Interceptors can be mixed-and-matched with
-the Interceptors bundled with the framework. Interceptors “set the stage” for
the Action classes, doing much of
+<p>Interceptors can be configured on a per-action basis. Your own custom
Interceptors can be mixed-and-matched with
+the Interceptors bundled with the framework. Interceptors “set the stage” for
the Action classes, doing much of
the “heavy lifting” before the Action executes.</p>
<p><strong>Action Lifecycle</strong></p>
<p><img src="attachments/att1607_overview.png" alt="overview.png" /></p>
-<p>In some cases, an Interceptor might keep an Action from firing, because of
a double-submit or because validation failed.
+<p>In some cases, an Interceptor might keep an Action from firing, because of
a double-submit or because validation failed.
Interceptors can also change the state of an Action before it executes.</p>
-<p>The Interceptors are defined in a stack that specifies the execution order.
In some cases, the order of the Interceptors
+<p>The Interceptors are defined in a stack that specifies the execution order.
In some cases, the order of the Interceptors
on the stack can be very important.</p>
<h2 id="configuring-interceptors">Configuring Interceptors</h2>
<p><strong>struts.xml</strong></p>
-<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code><span class="nt"><package</span> <span
class="na">name=</span><span class="s">"default"</span> <span
class="na">extends=</span><span class="s">"struts-default"</span><span
class="nt">></span>
- <span class="nt"><interceptors></span>
- <span class="nt"><interceptor</span> <span
class="na">name=</span><span class="s">"timer"</span> <span
class="na">class=</span><span class="s">".."</span><span class="nt">/></span>
- <span class="nt"><interceptor</span> <span
class="na">name=</span><span class="s">"logger"</span> <span
class="na">class=</span><span class="s">".."</span><span class="nt">/></span>
- <span class="nt"></interceptors></span>
-
- <span class="nt"><action</span> <span class="na">name=</span><span
class="s">"login"</span> <span class="na">class=</span><span
class="s">"tutorial.Login"</span><span class="nt">></span>
- <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"timer"</span><span
class="nt">/></span>
- <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"logger"</span><span
class="nt">/></span>
- <span class="nt"><result</span> <span class="na">name=</span><span
class="s">"input"</span><span class="nt">></span>login.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>/secure/home<span
class="nt"></result></span>
- <span class="nt"></action></span>
+<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code>
+<span class="nt"><package</span> <span class="na">name=</span><span
class="s">"default"</span> <span class="na">extends=</span><span
class="s">"struts-default"</span><span class="nt">></span>
+ <span class="nt"><interceptors></span>
+ <span class="nt"><interceptor</span> <span
class="na">name=</span><span class="s">"timer"</span> <span
class="na">class=</span><span class="s">".."</span><span class="nt">/></span>
+ <span class="nt"><interceptor</span> <span
class="na">name=</span><span class="s">"logger"</span> <span
class="na">class=</span><span class="s">".."</span><span class="nt">/></span>
+ <span class="nt"></interceptors></span>
+
+ <span class="nt"><action</span> <span class="na">name=</span><span
class="s">"login"</span> <span class="na">class=</span><span
class="s">"tutorial.Login"</span><span class="nt">></span>
+ <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"timer"</span><span
class="nt">/></span>
+ <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"logger"</span><span
class="nt">/></span>
+ <span class="nt"><result</span> <span class="na">name=</span><span
class="s">"input"</span><span class="nt">></span>login.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>/secure/home<span
class="nt"></result></span>
+ <span class="nt"></action></span>
<span class="nt"></package></span>
</code></pre></div></div>
<h2 id="stacking-interceptors">Stacking Interceptors</h2>
-<p>With most web applications, we find ourselves wanting to apply the same set
of Interceptors over and over again. Rather
+<p>With most web applications, we find ourselves wanting to apply the same set
of Interceptors over and over again. Rather
than reiterate the same list of Interceptors, we can bundle these Interceptors
together using an Interceptor Stack.</p>
<p><strong>struts.xml</strong></p>
-<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code><span class="nt"><package</span> <span
class="na">name=</span><span class="s">"default"</span> <span
class="na">extends=</span><span class="s">"struts-default"</span><span
class="nt">></span>
- <span class="nt"><interceptors></span>
+<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code>
+<span class="nt"><package</span> <span class="na">name=</span><span
class="s">"default"</span> <span class="na">extends=</span><span
class="s">"struts-default"</span><span class="nt">></span>
+ <span class="nt"><interceptors></span>
<span class="nt"><interceptor</span> <span
class="na">name=</span><span class="s">"timer"</span> <span
class="na">class=</span><span class="s">".."</span><span class="nt">/></span>
<span class="nt"><interceptor</span> <span
class="na">name=</span><span class="s">"logger"</span> <span
class="na">class=</span><span class="s">".."</span><span class="nt">/></span>
<span class="nt"><interceptor-stack</span> <span
class="na">name=</span><span class="s">"myStack"</span><span
class="nt">></span>
- <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"timer"</span><span
class="nt">/></span>
- <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"logger"</span><span
class="nt">/></span>
+ <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"timer"</span><span
class="nt">/></span>
+ <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"logger"</span><span
class="nt">/></span>
<span class="nt"></interceptor-stack></span>
<span class="nt"></interceptors></span>
- <span class="nt"><action</span> <span class="na">name=</span><span
class="s">"login"</span> <span class="na">class=</span><span
class="s">"tutuorial.Login"</span><span class="nt">></span>
- <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"myStack"</span><span
class="nt">/></span>
- <span class="nt"><result</span> <span class="na">name=</span><span
class="s">"input"</span><span class="nt">></span>login.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>/secure/home<span
class="nt"></result></span>
- <span class="nt"></action></span>
+ <span class="nt"><action</span> <span class="na">name=</span><span
class="s">"login"</span> <span class="na">class=</span><span
class="s">"tutuorial.Login"</span><span class="nt">></span>
+ <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"myStack"</span><span
class="nt">/></span>
+ <span class="nt"><result</span> <span class="na">name=</span><span
class="s">"input"</span><span class="nt">></span>login.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>/secure/home<span
class="nt"></result></span>
+ <span class="nt"></action></span>
<span class="nt"></package></span>
</code></pre></div></div>
@@ -519,14 +513,14 @@ than reiterate the same list of Interceptors, we can
bundle these Interceptors t
<span class="nt"></struts></span></code></pre></figure>
-<p>Since the <code class="language-plaintext
highlighter-rouge">struts-default.xml</code> is included in the application’s
configuration by default, all the predefined
+<p>Since the <code class="language-plaintext
highlighter-rouge">struts-default.xml</code> is included in the application’s
configuration by default, all the predefined
interceptors and stacks are available “out of the box”.</p>
<h2 id="framework-interceptors">Framework Interceptors</h2>
-<p>Interceptor classes are also defined using a key-value pair specified in
the Struts configuration file. The names
-specified below come specified in <a
href="struts-default-xml">struts-default.xml</a>. If you extend the <code
class="language-plaintext highlighter-rouge">struts-default</code>
-package, then you can use the names below. Otherwise, they must be defined in
your package with a name-class pair
+<p>Interceptor classes are also defined using a key-value pair specified in
the Struts configuration file. The names
+specified below come specified in <a
href="struts-default-xml">struts-default.xml</a>. If you extend the <code
class="language-plaintext highlighter-rouge">struts-default</code>
+package, then you can use the names below. Otherwise, they must be defined in
your package with a name-class pair
specified in the <code class="language-plaintext
highlighter-rouge"><interceptors/></code> tag.</p>
<table>
@@ -538,6 +532,11 @@ specified in the <code class="language-plaintext
highlighter-rouge"><intercep
</tr>
</thead>
<tbody>
+ <tr>
+ <td><a href="action-file-upload-interceptor">Action File Upload
Interceptor</a></td>
+ <td>actionFileUpload</td>
+ <td>Available since Struts 6.4.0: an Interceptor that adds easy access
to file upload support.</td>
+ </tr>
<tr>
<td><a href="alias-interceptor">Alias Interceptor</a></td>
<td>alias</td>
@@ -631,7 +630,7 @@ specified in the <code class="language-plaintext
highlighter-rouge"><intercep
<tr>
<td><a href="file-upload-interceptor">File Upload Interceptor</a></td>
<td>fileUpload</td>
- <td>An Interceptor that adds easy access to file upload support.</td>
+ <td><strong>DEPERECTED</strong> since Struts 6.4.0: an Interceptor that
adds easy access to file upload support.</td>
</tr>
<tr>
<td><a href="i18n-interceptor">I18n Interceptor</a></td>
@@ -731,27 +730,29 @@ specified in the <code class="language-plaintext
highlighter-rouge"><intercep
</tbody>
</table>
-<p>Since 2.0.7, Interceptors and Results with hyphenated names were converted
to camelCase. (The former model-driven is
-now modelDriven.) The original hyphenated names are retained as “aliases”
until Struts 2.1.0. For clarity,
+<p>Since 2.0.7, Interceptors and Results with hyphenated names were converted
to camelCase. (The former model-driven is
+now modelDriven.) The original hyphenated names are retained as “aliases”
until Struts 2.1.0. For clarity,
the hyphenated versions are not listed here, but might be referenced in prior
versions of the documentation.</p>
<h2 id="method-filtering">Method Filtering</h2>
-<p><code class="language-plaintext
highlighter-rouge">MethodFilterInterceptor</code> is an abstract <code
class="language-plaintext highlighter-rouge">Interceptor</code> used as a base
class for interceptors that will filter execution
+<p><code class="language-plaintext
highlighter-rouge">MethodFilterInterceptor</code> is an abstract <code
class="language-plaintext highlighter-rouge">Interceptor</code> used as a base
class for interceptors that will filter execution
based on method names according to specified included/excluded method
lists.</p>
<p>Settable parameters are as follows:</p>
+
<ul>
<li>excludeMethods - method names to be excluded from interceptor
processing</li>
<li>includeMethods - method names to be included in interceptor
processing</li>
</ul>
<blockquote>
- <p>If method name are available in both includeMethods and excludeMethods,
it will be considered as an included method:
+ <p>If method name are available in both includeMethods and excludeMethods,
it will be considered as an included method:
includeMethods takes precedence over excludeMethods.</p>
</blockquote>
<p>Interceptors that extends this capability include:</p>
+
<ul>
<li><code class="language-plaintext
highlighter-rouge">TokenInterceptor</code></li>
<li><code class="language-plaintext
highlighter-rouge">TokenSessionStoreInterceptor</code></li>
@@ -765,7 +766,8 @@ includeMethods takes precedence over excludeMethods.</p>
<p><strong>Method 1</strong>:</p>
-<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code><span class="nt"><action</span> <span
class="na">name=</span><span class="s">"myAction"</span> <span
class="na">class=</span><span class="s">"myActionClass"</span><span
class="nt">></span>
+<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code>
+<span class="nt"><action</span> <span class="na">name=</span><span
class="s">"myAction"</span> <span class="na">class=</span><span
class="s">"myActionClass"</span><span class="nt">></span>
<span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"exception"</span><span
class="nt">/></span>
<span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"alias"</span><span
class="nt">/></span>
<span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"params"</span><span
class="nt">/></span>
@@ -789,7 +791,8 @@ includeMethods takes precedence over excludeMethods.</p>
<p><strong>Method 2</strong>:</p>
-<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code><span class="nt"><action</span> <span
class="na">name=</span><span class="s">"myAction"</span> <span
class="na">class=</span><span class="s">"myActionClass"</span><span
class="nt">></span>
+<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code>
+<span class="nt"><action</span> <span class="na">name=</span><span
class="s">"myAction"</span> <span class="na">class=</span><span
class="s">"myActionClass"</span><span class="nt">></span>
<span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"defaultStack"</span><span
class="nt">></span>
<span class="nt"><param</span> <span class="na">name=</span><span
class="s">"validation.excludeMethods"</span><span
class="nt">></span>myValidationExcludeMethod<span
class="nt"></param></span>
<span class="nt"><param</span> <span class="na">name=</span><span
class="s">"workflow.excludeMethods"</span><span
class="nt">></span>myWorkflowExcludeMethod<span
class="nt"></param></span>
@@ -799,20 +802,21 @@ includeMethods takes precedence over excludeMethods.</p>
<p>In the first method, the whole default stack is copied and the parameter
then changed accordingly.</p>
-<p>In the second method, the <code class="language-plaintext
highlighter-rouge">interceptor-ref</code> refers to an existing
interceptor-stack, namely <code class="language-plaintext
highlighter-rouge">defaultStack</code> in this
+<p>In the second method, the <code class="language-plaintext
highlighter-rouge">interceptor-ref</code> refers to an existing
interceptor-stack, namely <code class="language-plaintext
highlighter-rouge">defaultStack</code> in this
example, and override the <code class="language-plaintext
highlighter-rouge">validator</code> and <code class="language-plaintext
highlighter-rouge">workflow</code> interceptor <code class="language-plaintext
highlighter-rouge">excludeMethods</code> attribute. Note that in the <code
class="language-plaintext highlighter-rouge">param</code>
-tag, the name attribute contains a dot (.) the word before the dot(.)
specifies the interceptor name whose parameter is
+tag, the name attribute contains a dot (.) the word before the dot(.)
specifies the interceptor name whose parameter is
to be overridden and the word after the dot (.) specifies the parameter
itself. The syntax is as follows:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre
class="highlight"><code> <interceptor-name>.<parameter-name>
</code></pre></div></div>
-<p>Note also that in this case the <code class="language-plaintext
highlighter-rouge">interceptor-ref</code> name attribute is used to indicate an
interceptor stack which makes
+<p>Note also that in this case the <code class="language-plaintext
highlighter-rouge">interceptor-ref</code> name attribute is used to indicate an
interceptor stack which makes
sense as if it is referring to the interceptor itself it would be just using
Method 1 describe above.</p>
<p><strong>Method 3</strong>:</p>
-<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code><span class="nt"><interceptors></span>
+<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code>
+<span class="nt"><interceptors></span>
<span class="nt"><interceptor-stack</span> <span
class="na">name=</span><span class="s">"parentStack"</span><span
class="nt">></span>
<span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"defaultStack"</span><span
class="nt">></span>
<span class="nt"><param</span> <span
class="na">name=</span><span class="s">"params.excludeParams"</span><span
class="nt">></span>token<span class="nt"></param></span>
@@ -825,46 +829,49 @@ sense as if it is referring to the interceptor itself it
would be just using Met
<h2 id="interceptor-parameter-overriding-inheritance">Interceptor Parameter
Overriding Inheritance</h2>
-<p>Parameters override are not inherited in interceptors, meaning that the
last set of overridden parameters will be used.
+<p>Parameters override are not inherited in interceptors, meaning that the
last set of overridden parameters will be used.
For example, if a stack overrides the parameter “defaultBlock” for the
“postPrepareParameterFilter” interceptor as:</p>
-<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code><span class="nt"><interceptor-stack</span> <span
class="na">name=</span><span class="s">"parentStack"</span><span
class="nt">></span>
- <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"postPrepareParameterFilter"</span><span
class="nt">></span>
- <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"defaultBlock"</span><span class="nt">></span>true<span
class="nt"></param></span>
- <span class="nt"></interceptor-ref></span>
+<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code>
+<span class="nt"><interceptor-stack</span> <span
class="na">name=</span><span class="s">"parentStack"</span><span
class="nt">></span>
+ <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"postPrepareParameterFilter"</span><span
class="nt">></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"defaultBlock"</span><span class="nt">></span>true<span
class="nt"></param></span>
+ <span class="nt"></interceptor-ref></span>
<span class="nt"></interceptor-stack></span>
</code></pre></div></div>
<p>and an action overrides the “allowed” for “postPrepareParameterFilter”:</p>
-<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code><span class="nt"><package</span> <span
class="na">name=</span><span class="s">"child2"</span> <span
class="na">namespace=</span><span class="s">"/child"</span> <span
class="na">extends=</span><span class="s">"parentPackage"</span><span
class="nt">></span>
- <span class="nt"><action</span> <span class="na">name=</span><span
class="s">"list"</span> <span class="na">class=</span><span
class="s">"SomeAction"</span><span class="nt">></span>
- <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"parentStack"</span><span
class="nt">></span>
- <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"postPrepareParameterFilter.allowed"</span><span
class="nt">></span>myObject.name<span class="nt"></param></span>
- <span class="nt"></interceptor-ref></span>
- <span class="nt"></action></span>
+<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code>
+<span class="nt"><package</span> <span class="na">name=</span><span
class="s">"child2"</span> <span class="na">namespace=</span><span
class="s">"/child"</span> <span class="na">extends=</span><span
class="s">"parentPackage"</span><span class="nt">></span>
+ <span class="nt"><action</span> <span class="na">name=</span><span
class="s">"list"</span> <span class="na">class=</span><span
class="s">"SomeAction"</span><span class="nt">></span>
+ <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"parentStack"</span><span
class="nt">></span>
+ <span class="nt"><param</span> <span
class="na">name=</span><span
class="s">"postPrepareParameterFilter.allowed"</span><span
class="nt">></span>myObject.name<span class="nt"></param></span>
+ <span class="nt"></interceptor-ref></span>
+ <span class="nt"></action></span>
<span class="nt"></package></span>
</code></pre></div></div>
-<p>Then, only “allowed” will be overridden for the
“postPrepareParameterFilter” interceptor in that action,
+<p>Then, only “allowed” will be overridden for the
“postPrepareParameterFilter” interceptor in that action,
the other params will be null.</p>
<h2 id="lazy-parameters">Lazy parameters</h2>
<p>This functionality was added in Struts 2.5.9</p>
-<p>It is possible to define an interceptor with parameters evaluated during
action invocation. In such case
-the interceptor must be marked with <code class="language-plaintext
highlighter-rouge">WithLazyParams</code> interface. This must be developer’s
decision as interceptor
-must be aware of having those parameters set during invocation and not when
the interceptor is created as it happens
+<p>It is possible to define an interceptor with parameters evaluated during
action invocation. In such case
+the interceptor must be marked with <code class="language-plaintext
highlighter-rouge">WithLazyParams</code> interface. This must be developer’s
decision as interceptor
+must be aware of having those parameters set during invocation and not when
the interceptor is created as it happens
in normal way.</p>
<p>Params are evaluated as any other expression starting with from action as a
top object.</p>
-<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code><span class="nt"><action</span> <span
class="na">name=</span><span class="s">"LazyFoo"</span> <span
class="na">class=</span><span
class="s">"com.opensymphony.xwork2.SimpleAction"</span><span
class="nt">></span>
- <span class="nt"><result</span> <span class="na">name=</span><span
class="s">"success"</span><span class="nt">></span>result.jsp<span
class="nt"></result></span>
- <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"lazy"</span><span class="nt">></span>
- <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"foo"</span><span class="nt">></span>${bar}<span
class="nt"></param></span>
- <span class="nt"></interceptor-ref></span>
+<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code>
+<span class="nt"><action</span> <span class="na">name=</span><span
class="s">"LazyFoo"</span> <span class="na">class=</span><span
class="s">"com.opensymphony.xwork2.SimpleAction"</span><span
class="nt">></span>
+ <span class="nt"><result</span> <span class="na">name=</span><span
class="s">"success"</span><span class="nt">></span>result.jsp<span
class="nt"></result></span>
+ <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"lazy"</span><span class="nt">></span>
+ <span class="nt"><param</span> <span class="na">name=</span><span
class="s">"foo"</span><span class="nt">></span>${bar}<span
class="nt"></param></span>
+ <span class="nt"></interceptor-ref></span>
<span class="nt"></action></span>
</code></pre></div></div>
@@ -883,7 +890,7 @@ in normal way.</p>
<span class="o">}</span>
</code></pre></div></div>
-<p>Please be aware that order of interceptors can matter when want to access
parameters passed via request as those
+<p>Please be aware that order of interceptors can matter when want to access
parameters passed via request as those
parameters are set by <a href="parameters-interceptor">Parameters
Interceptor</a>.</p>
<h2 id="disabling-interceptor">Disabling interceptor</h2>
@@ -894,7 +901,8 @@ overriding logic to set the <code class="language-plaintext
highlighter-rouge">d
<p>An example how to disable the Validation interceptor:</p>
-<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code><span class="nt"><action</span> <span
class="na">name=</span><span class="s">"myAction"</span> <span
class="na">class=</span><span class="s">"myActionClass"</span><span
class="nt">></span>
+<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code>
+<span class="nt"><action</span> <span class="na">name=</span><span
class="s">"myAction"</span> <span class="na">class=</span><span
class="s">"myActionClass"</span><span class="nt">></span>
<span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"defaultStack"</span><span
class="nt">></span>
<span class="nt"><param</span> <span class="na">name=</span><span
class="s">"validation.disabled"</span><span class="nt">></span>true<span
class="nt"></param></span>
<span class="nt"></interceptor-ref></span>
@@ -903,13 +911,15 @@ overriding logic to set the <code
class="language-plaintext highlighter-rouge">d
<h2 id="order-of-interceptor-execution">Order of Interceptor Execution</h2>
-<p>Interceptors provide an excellent means to wrap before/after processing.
The concept reduces code duplication (think AOP).</p>
+<p>Interceptors provide an excellent means to wrap before/after processing.
The concept reduces code duplication (think
+AOP).</p>
-<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code><span class="nt"><interceptor-stack</span> <span
class="na">name=</span><span class="s">"xaStack"</span><span
class="nt">></span>
- <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span
class="s">"thisWillRunFirstInterceptor"</span><span class="nt">/></span>
- <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"thisWillRunNextInterceptor"</span><span
class="nt">/></span>
- <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"followedByThisInterceptor"</span><span
class="nt">/></span>
- <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"thisWillRunLastInterceptor"</span><span
class="nt">/></span>
+<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code>
+<span class="nt"><interceptor-stack</span> <span
class="na">name=</span><span class="s">"xaStack"</span><span
class="nt">></span>
+ <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span
class="s">"thisWillRunFirstInterceptor"</span><span class="nt">/></span>
+ <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"thisWillRunNextInterceptor"</span><span
class="nt">/></span>
+ <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"followedByThisInterceptor"</span><span
class="nt">/></span>
+ <span class="nt"><interceptor-ref</span> <span
class="na">name=</span><span class="s">"thisWillRunLastInterceptor"</span><span
class="nt">/></span>
<span class="nt"></interceptor-stack></span>
</code></pre></div></div>
@@ -917,7 +927,7 @@ overriding logic to set the <code class="language-plaintext
highlighter-rouge">d
<p>Note that some Interceptors will interrupt the stack/chain/flow … so the
order is very important.</p>
</blockquote>
-<p>Interceptors implementing <code class="language-plaintext
highlighter-rouge">com.opensymphony.xwork2.interceptor.PreResultListener</code>
will run after the Action executes
+<p>Interceptors implementing <code class="language-plaintext
highlighter-rouge">com.opensymphony.xwork2.interceptor.PreResultListener</code>
will run after the Action executes
but before the Result executes.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre
class="highlight"><code>thisWillRunFirstInterceptor
diff --git a/content/download.html b/content/download.html
index 917d303b6..731549cb1 100644
--- a/content/download.html
+++ b/content/download.html
@@ -209,7 +209,7 @@
The <a href="https://struts.apache.org/">Apache Struts 6.3.0.2</a> is an
elegant, extensible
framework for creating enterprise-ready Java web applications. It is
available in a full distribution,
or as separate library, source, example and documentation distributions.
- Struts 6.3.0.2 is the "best available" version of Struts in the 2.5 series.
+ Struts 6.3.0.2 is the "best available" version of Struts in the 6.x series.
</p>
<ul>