You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by gi...@apache.org on 2021/02/19 20:03:03 UTC
[struts-site] branch asf-site updated: Automatic Site Publish by
Buildbot
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 0b72f7b Automatic Site Publish by Buildbot
0b72f7b is described below
commit 0b72f7b59b78a7f2e4ad7fbccaeeeca2099a3e4c
Author: buildbot <us...@infra.apache.org>
AuthorDate: Fri Feb 19 20:02:59 2021 +0000
Automatic Site Publish by Buildbot
---
...essing-application-session-request-objects.html | 22 +++++++++++++++-------
output/tag-developers/set-tag.html | 7 ++++---
output/tag-developers/text-tag.html | 5 +++++
output/tag-developers/url-tag.html | 5 +++++
4 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/output/core-developers/accessing-application-session-request-objects.html b/output/core-developers/accessing-application-session-request-objects.html
index 5ee2287..21bf18c 100644
--- a/output/core-developers/accessing-application-session-request-objects.html
+++ b/output/core-developers/accessing-application-session-request-objects.html
@@ -144,16 +144,16 @@
<p><strong>Accessing servlet scopes</strong></p>
<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">Map</span> <span class="n">attr</span> <span class="o">=</span> <span class="o">(</span><span class="n">Map</span><span class="o">)</span> <span class="n">ActionContext</span><span class="o">.</span><span class="na">getContext</span><span class="o">().</span><span class="na">get</span><span class="o">(</span><span class="s">"attr"</span><span class="o">);</span>
-<span class="n">attr</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">"myId"</span><span class="o">,</span><span class="n">myProp</span><span class="o">);</span>
+<span class="n">attr</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">"myId"</span><span class="o">,</span> <span class="n">myProp</span><span class="o">);</span> <span class="c1">// Page scope.</span>
<span class="n">Map</span> <span class="n">application</span> <span class="o">=</span> <span class="o">(</span><span class="n">Map</span><span class="o">)</span> <span class="n">ActionContext</span><span class="o">.</span><span class="na">getContext</span><span class="o">().</span><span class="na">get</span><span class="o">(</span><span class="s">"application"</span><span class="o">);</span>
-<span class="n">application</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">"myId"</span><span class="o">,</span><span class="n">myProp</span><span class="o">);</span>
+<span class="n">application</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">"myId"</span><span class="o">,</span> <span class="n">myProp</span><span class="o">);</span>
<span class="n">Map</span> <span class="n">session</span> <span class="o">=</span> <span class="o">(</span><span class="n">Map</span><span class="o">)</span> <span class="n">ActionContext</span><span class="o">.</span><span class="na">getContext</span><span class="o">().</span><span class="na">get</span><span class="o">(</span><span class="s">"session"</span><span class="o">);</span>
<span class="n">session</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">"myId"</span><span class="o">,</span> <span class="n">myProp</span><span class="o">);</span>
<span class="n">Map</span> <span class="n">request</span> <span class="o">=</span> <span class="o">(</span><span class="n">Map</span><span class="o">)</span> <span class="n">ActionContext</span><span class="o">.</span><span class="na">getContext</span><span class="o">().</span><span class="na">get</span><span class="o">(</span><span class="s">"request"</span><span class="o">);</span>
-<span class="n">request</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">"myId"</span><span class="o">,</span><span class="n">myProp</span><span class="o">);</span>
+<span class="n">request</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">"myId"</span><span class="o">,</span> <span class="n">myProp</span><span class="o">);</span>
</code></pre></div></div>
<blockquote>
@@ -174,18 +174,26 @@ is an alternative way to access the request and response objects, with the same
<h2 id="accessing-from-the-view-jsp-freemarker-etc">Accessing from the view (JSP, FreeMarker, etc.)</h2>
-<p>Request and session attributes are accessed via OGNL using the <code class="highlighter-rouge">#session</code> and <code class="highlighter-rouge">#request</code> stack values.</p>
+<p>Request and session attributes are accessed via OGNL using the <code class="highlighter-rouge">#session</code> and <code class="highlighter-rouge">#request</code> stack values.
+Page attributes are accessed via OGNL using the <code class="highlighter-rouge">#attr</code> stack value, and Application attributes via
+the <code class="highlighter-rouge">#application</code> stack value.</p>
<p>The <code class="highlighter-rouge">#attr</code> stack value will search the <code class="highlighter-rouge">javax.servlet.jsp.PageContext</code> for the specified key. If the <code class="highlighter-rouge">PageContext</code>
-doean’t exist, it will search the request, session, and application scopes, in that order.</p>
+doesn’t exist, it will search the request, session, and application scopes, in that order.</p>
-<p><strong>Accessing the Session or Request from a JSP</strong></p>
+<p><strong>Accessing attributes in the Application, Session, Request, or Page scope from a JSP</strong></p>
-<pre><code class="language-jsp"><s:property value="#session.myId" />
+<pre><code class="language-jsp"><p>Retrieve the attribute (property), with key myId, from the specified scope:</p>
+
+<s:property value="#application.myId" />
+
+<s:property value="#session.myId" />
<s:property value="#request.myId" />
<s:property value="#attr.myId" />
+
+<p>Reminder: #attr is for Page scope attributes first, but will search the remaining scopes, in order, seeking a match.</p>
</code></pre>
</section>
diff --git a/output/tag-developers/set-tag.html b/output/tag-developers/set-tag.html
index 5b709b2..dcfb1d8 100644
--- a/output/tag-developers/set-tag.html
+++ b/output/tag-developers/set-tag.html
@@ -150,12 +150,13 @@ the body evaluates is set as value for the scoped variable.</p>
<li><code class="highlighter-rouge">application</code> - the value will be set in application scope according to servlet spec. using the name as its key</li>
<li><code class="highlighter-rouge">session</code> - the value will be set in session scope according to servlet spec. using the name as key</li>
<li><code class="highlighter-rouge">request</code> - the value will be set in request scope according to servlet spec. using the name as key</li>
- <li><code class="highlighter-rouge">page</code> - the value will be set in page scope according to servlet spec. using the name as key</li>
- <li><code class="highlighter-rouge">action</code> - the value will be set in the request scope and Struts’ action context using the name as key</li>
+ <li><code class="highlighter-rouge">page</code> - the value will be set in page scope according to servlet spec. using the name as key (retrieve via #attr)</li>
+ <li><code class="highlighter-rouge">action</code> - the value will be set in the page scope and Struts’ action context using the name as key</li>
</ul>
<blockquote>
- <p><strong>NOTE</strong>: If no scope is specified, it will default to <code class="highlighter-rouge">action</code> scope.</p>
+ <p><strong>NOTE</strong>: If no scope is specified, it will default to <code class="highlighter-rouge">action</code> scope. For the <code class="highlighter-rouge">set</code> tag <strong>specifically</strong>, this also
+places (sets) the generated value into the <code class="highlighter-rouge">page</code> scope as well (retrieve via #attr).</p>
</blockquote>
<p>Assigns a value to a variable in a specified scope</p>
diff --git a/output/tag-developers/text-tag.html b/output/tag-developers/text-tag.html
index 5f16c5b..9ee9672 100644
--- a/output/tag-developers/text-tag.html
+++ b/output/tag-developers/text-tag.html
@@ -218,6 +218,11 @@ If no value is found on the stack, the key of the message will be written out.</
</tr>
</table>
+<blockquote>
+ <p><strong>NOTE</strong>: When the <code class="highlighter-rouge">var</code> attribute is used with the <code class="highlighter-rouge">text</code> tag, the tag’s generated value <strong>will not</strong> be written out to the
+visible page (it will only be placed into the action scope).</p>
+</blockquote>
+
<h2 id="examples">Examples</h2>
<blockquote>
diff --git a/output/tag-developers/url-tag.html b/output/tag-developers/url-tag.html
index 6587c71..b69efa7 100644
--- a/output/tag-developers/url-tag.html
+++ b/output/tag-developers/url-tag.html
@@ -321,6 +321,11 @@ because the parameter defined in the <code class="highlighter-rouge">param</code
</tr>
</table>
+<blockquote>
+ <p><strong>NOTE</strong>: When the <code class="highlighter-rouge">var</code> attribute is used with the <code class="highlighter-rouge">url</code> tag, the tag’s generated URL value will be placed into the request scope
+<strong>in addition to</strong> the action scope.</p>
+</blockquote>
+
<h2 id="examples">Examples</h2>
<pre><code class="language-jsp"><!-- Example 1 -->