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 02faa0d Updates production by Jenkins 02faa0d is described below commit 02faa0d46095cdc2125db8226d9478e9786e4895 Author: jenkins <bui...@apache.org> AuthorDate: Wed Oct 4 20:00:52 2017 +0000 Updates production by Jenkins --- content/core-developers/httpheader-result.html | 2 +- .../core-developers/redirect-action-result.html | 166 +++++++++------------ content/core-developers/redirect-result.html | 71 ++++----- content/core-developers/stream-result.html | 128 ++-------------- 4 files changed, 113 insertions(+), 254 deletions(-) diff --git a/content/core-developers/httpheader-result.html b/content/core-developers/httpheader-result.html index efdae21..4af20b0 100644 --- a/content/core-developers/httpheader-result.html +++ b/content/core-developers/httpheader-result.html @@ -138,7 +138,7 @@ <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> + <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> diff --git a/content/core-developers/redirect-action-result.html b/content/core-developers/redirect-action-result.html index 6604013..8cac819 100644 --- a/content/core-developers/redirect-action-result.html +++ b/content/core-developers/redirect-action-result.html @@ -129,118 +129,86 @@ <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> <h1 id="redirect-action-result">Redirect Action Result</h1> -<p> <p> - This result uses the {@link ActionMapper} provided by the - ActionMapperFactory to redirect the browser to a URL that invokes the - specified action and (optional) namespace. This is better than the - {@link ServletRedirectResult} because it does not require you to encode the - URL patterns processed by the {@link ActionMapper} 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>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> - See examples below for an example of how request parameters could be passed - in. - </p></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> -<table> - <tbody> - <tr> - </tr> - </tbody> -</table> - -<p>####Parameters####</p> - -<p> - <ul> - <li><b>actionName (default)</b> - The name of the action that will be - redirected to.</li> - <li><b>namespace</b> - 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><b>suppressEmptyParameters</b> - Optional boolean (defaults to false) that - can prevent parameters with no values from being included in the redirect - URL.</li> - <li><b>parse</b> - Boolean, true by default. If set to false, the actionName - param will not be parsed for Ognl expressions.</li> - <li><b>anchor</b> - Optional. Also known as "fragment" or colloquially as - "hash". You can specify an anchor for a result.</li> - </ul> -</p> - -<p>####Examples####</p> - -<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> - - <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> - - <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> - - <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&width=100&height=100#summary - --></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> - - +<h3 id="parameters">Parameters</h3> + +<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">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> + +<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> + +<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> + + <action name="error" class="..."> + <result>error.jsp</result> + </action> +</package> + +<package name="passingRequestParameters" extends="struts-default" namespace="/passingRequestParameters"> + <!-- Pass parameters (reportType, width and height) --> + <!-- + 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> </code></pre> </div> <div class="highlighter-rouge"><pre class="highlight"><code><!-- - Example of "anchor" param usage in conjunction with "redirectAction" result-type. - - Generated URL: /displayReport.action#SUMMARY + Example of "anchor" param usage in conjunction with "redirectAction" result-type. + + Generated URL: /displayReport.action#SUMMARY --> - + <action name="displayReport"> - <result>/jsp/displayReport.jsp</result> + <result>/jsp/displayReport.jsp</result> </action> - + <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> + <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> - </code></pre> </div> diff --git a/content/core-developers/redirect-result.html b/content/core-developers/redirect-result.html index cdeb102..358b862 100644 --- a/content/core-developers/redirect-result.html +++ b/content/core-developers/redirect-result.html @@ -129,47 +129,35 @@ <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> <h1 id="redirect-result">Redirect Result</h1> -<p> <p> - Calls the {@link HttpServletResponse#sendRedirect(String) sendRedirect} - 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 - (url?name=value) which can be OGNL expressions. - </p></p> - -<p>####Parameters####</p> - -<p> - <ul> - - <li><b>location (default)</b> - the location to go to after execution.</li> - - <li><b>parse</b> - true by default. If set to false, the location param will - not be parsed for Ognl expressions.</li> - - <li><b>anchor</b> - 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 {@link StrutsResultSupport}. - </p> - </p> - -<p>####Examples####</p> - -<div class="highlighter-rouge"><pre class="highlight"><code> <span class="c"><!-- - The redirect URL generated will be: - /foo.jsp#FRAGMENT - --></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> +<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 [...] + +<h3 id="parameters">Parameters</h3> + +<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> +</ul> + +<p>This result follows the same rules from StrutsResultSupport.</p> + +<h3 id="examples">Examples</h3> + +<div class="highlighter-rouge"><pre class="highlight"><code><!-- + 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> </code></pre> </div> @@ -190,7 +178,6 @@ </result> </action> </package> - </code></pre> </div> diff --git a/content/core-developers/stream-result.html b/content/core-developers/stream-result.html index 809994e..19edf93 100644 --- a/content/core-developers/stream-result.html +++ b/content/core-developers/stream-result.html @@ -129,123 +129,30 @@ <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> <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.</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> -<table> - <tbody> - <tr> - <td>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></td> - </tr> - </tbody> -</table> - -<table> - <tbody> - <tr> - </tr> - </tbody> -</table> - -<p>####Parameters####</p> +<h3 id="parameters">Parameters</h3> <ul> - <li><strong>contentType</strong> - the stream mime-type as sent to the web browser (default =</li> + <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">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> </ul> -<div class="highlighter-rouge"><pre class="highlight"><code>text/plain -</code></pre> -</div> -<p>).</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> -<ul> - <li> - <p><strong>contentLength</strong> - the stream length in bytes (the browser displays a progress bar).</p> - </li> - <li> - <p><strong>contentDisposition</strong> - the content disposition header value for specifying the file name (default =</p> - </li> -</ul> +<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> -<div class="highlighter-rouge"><pre class="highlight"><code>inline -</code></pre> -</div> -<p>, values are typically <em>attachment;filename=”document.pdf”</em> .</p> +<h3 id="examples">Examples</h3> -<ul> - <li> - <p><strong>inputName </strong>- the name of the InputStream property from the chained action (default = <strong>inputStream</strong>).</p> - </li> - <li> - <p><strong>bufferSize </strong>- the size of the buffer to copy from input to output (default =</p> - </li> -</ul> +<h4 id="annotation-based-configuration">Annotation based Configuration</h4> -<div class="highlighter-rouge"><pre class="highlight"><code>1024 -</code></pre> -</div> -<p>).</p> - -<ul> - <li><strong>allowCaching</strong> - if set to ‘false’ it will set the headers</li> -</ul> - -<div class="highlighter-rouge"><pre class="highlight"><code>Pragma -</code></pre> -</div> -<p> and</p> - -<div class="highlighter-rouge"><pre class="highlight"><code>Cache-Control -</code></pre> -</div> -<p> to</p> - -<div class="highlighter-rouge"><pre class="highlight"><code>no-cahce -</code></pre> -</div> -<p>, and prevent client from caching the content (default =</p> - -<div class="highlighter-rouge"><pre class="highlight"><code>true -</code></pre> -</div> -<p>).</p> - -<ul> - <li><strong>contentCharSet</strong> - 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</p> - -<div class="highlighter-rouge"><pre class="highlight"><code>getContentType() -</code></pre> -</div> -<p> to override that parameter for the current action. To do it you you must explicitly define this param as an expression i.e.</p> - -<p><strong>parameter defined as an expression</strong></p> - -<div class="highlighter-rouge"><pre class="highlight"><code><param name="contentType">${contentType}</param> -</code></pre> -</div> - -<table> - <tbody> - <tr> - <td>Please be aware that this was changed since Struts 2.5.2, previously each parameter was automagically resolved by looking throughout the ValueStack, now you must explicitly define wich parameter must be evaluated, even inputName.</td> - </tr> - </tbody> -</table> - -<table> - <tbody> - <tr> - </tr> - </tbody> -</table> - -<p>####Examples####</p> - -<p>#####Annotation based Configuration#####</p> - -<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 <em>Convention Plugin</em> in your Struts2 application.</p> <div class="highlighter-rouge"><pre class="highlight"><code>package com.mycompany.webapp.actions; @@ -295,13 +202,10 @@ public class FileDisplay extends ActionSupport { return this.stream; } } - </code></pre> </div> -<p>#####XML based Configuration#####</p> - -<p><strong>Example configuration</strong></p> +<h4 id="xml-based-configuration">XML based Configuration</h4> <div class="highlighter-rouge"><pre class="highlight"><code><result name="success" type="stream"> <param name="contentType">image/jpeg</param> -- To stop receiving notification emails like this one, please contact ['"commits@struts.apache.org" <commits@struts.apache.org>'].