📄 struts-logic.html
字号:
object, <code>ActionErrors</code> object, a String,
or a String array is in request scope. If
such a bean is not found, nothing will be rendered.
</p>
<p>Since: Struts 1.1</p>
<table class="tag-attributes">
<thead>
<tr>
<th class="attribute">Attribute Name</th>
<th>Description</th>
</tr>
</thead>
<tr class="evenRow">
<td align="center">name</td>
<td>
<p>The parameter key to retrieve the message from request scope.</p>
[RT Expr]
</td>
</tr>
<tr class="oddRow">
<td align="center">property</td>
<td>
<p>Name of the property for which messages should be
retrieved. If not specified, all messages (regardless
of property) are retrieved.
</p>
[RT Expr]
</td>
</tr>
<tr class="evenRow">
<td align="center">message</td>
<td>
<p>By default the tag will retrieve the request scope bean it will
iterate over from the <code>Globals.ERROR_KEY</code> constant string,
but if this attribute is set to 'true' the request scope bean
will be retrieved from the <code>Globals.MESSAGE_KEY</code>
constant string. Also if this is set to 'true', any value
assigned to the name attribute will be ignored.
</p>
[RT Expr]
</td>
</tr>
</table>
</div>
<p>
<a href="#top">Back to top</a>
</p>
<h3 id="notEmpty">
<strong>notEmpty</strong> -
Evaluate the nested body content of this tag if the requested variable is
neither null, nor an empty string, nor an empty java.util.Collection
(tested by the .isEmpty() method on the java.util.Collection interface).
</h3>
<div class="indent">
<p>This tag evaluates its nested body content only if the specified value
is present (i.e. not <code>null</code>) and is not an empty string (i.e. a
<code>java.lang.String</code> with a length of zero).</p>
<p>
<strong>JSTL</strong>: The equivalent JSTL tag is <c:if> using the
<code>! empty</code> operator. For example,
<br />
<code>
<c:if test="${ ! empty sessionScope.myBean.myProperty}">
do something
</c:if>
</code>
</p>
<table class="tag-attributes">
<thead>
<tr>
<th class="attribute">Attribute Name</th>
<th>Description</th>
</tr>
</thead>
<tr class="evenRow">
<td align="center">name</td>
<td>
<p>The variable to be compared is the JSP bean specified by this
attribute, if <code>property</code> is not specified, or the value
of the specified property of this bean, if <code>property</code>
is specified.</p>
[RT Expr]
</td>
</tr>
<tr class="oddRow">
<td align="center">property</td>
<td>
<p>The variable to be compared is the property (of the bean specified
by the <code>name</code> attribute) specified by this attribute.
The property reference can be simple, nested, and/or indexed.</p>
[RT Expr]
</td>
</tr>
<tr class="evenRow">
<td align="center">scope</td>
<td>
<p>The bean scope within which to search for the bean named by the
<code>name</code> property, or "any scope" if not specified.</p>
[RT Expr]
</td>
</tr>
</table>
</div>
<p>
<a href="#top">Back to top</a>
</p>
<h3 id="notEqual">
<strong>notEqual</strong> -
Evaluate the nested body content of this tag if the requested
variable is not equal to the specified value.
</h3>
<div class="indent">
<p>Compares the variable specified by one of the selector attributes
against the specified constant value. The nested body content of this
tag is evaluated if the variable and value are <strong>not equal</strong>.
</p>
<table class="tag-attributes">
<thead>
<tr>
<th class="attribute">Attribute Name</th>
<th>Description</th>
</tr>
</thead>
<tr class="evenRow">
<td align="center">cookie</td>
<td>
<p>The variable to be compared is the value of the cookie whose
name is specified by this attribute.</p>
[RT Expr]
</td>
</tr>
<tr class="oddRow">
<td align="center">header</td>
<td>
<p>The variable to be compared is the value of the header whose
name is specified by this attribute. The name match is performed
in a case insensitive manner.</p>
[RT Expr]
</td>
</tr>
<tr class="evenRow">
<td align="center">name</td>
<td>
<p>The variable to be compared is the JSP bean specified by this
attribute, if <code>property</code> is not specified, or the value
of the specified property of this bean, if <code>property</code>
is specified.</p>
[RT Expr]
</td>
</tr>
<tr class="oddRow">
<td align="center">parameter</td>
<td>
<p>The variable to be compared is the first, or only, value of the
request parameter specified by this attribute.</p>
[RT Expr]
</td>
</tr>
<tr class="evenRow">
<td align="center">property</td>
<td>
<p>The variable to be compared is the property (of the bean specified
by the <code>name</code> attribute) specified by this attribute.
The property reference can be simple, nested, and/or indexed.</p>
[RT Expr]
</td>
</tr>
<tr class="oddRow">
<td align="center">scope</td>
<td>
<p>The bean scope within which to search for the bean named by the
<code>name</code> property, or "any scope" if not specified.</p>
[RT Expr]
</td>
</tr>
<tr class="evenRow">
<td align="center">value</td>
<td>
<p>The constant value to which the variable, specified by other
attribute(s) of this tag, will be compared.</p>
[Required]
[RT Expr]
</td>
</tr>
</table>
</div>
<p>
<a href="#top">Back to top</a>
</p>
<h3 id="notMatch">
<strong>notMatch</strong> -
Evaluate the nested body content of this tag if the specified value
is not an appropriate substring of the requested variable.
</h3>
<div class="indent">
<p>Matches the variable specified by one of the selector attributes
(as a String) against the specified constant value. If the value is
not a substring (appropriately limited by the <code>location</code>
attribute), the nested body content of this tag is evaluated.</p>
<table class="tag-attributes">
<thead>
<tr>
<th class="attribute">Attribute Name</th>
<th>Description</th>
</tr>
</thead>
<tr class="evenRow">
<td align="center">cookie</td>
<td>
<p>The variable to be matched is the value of the cookie whose
name is specified by this attribute.</p>
[RT Expr]
</td>
</tr>
<tr class="oddRow">
<td align="center">header</td>
<td>
<p>The variable to be matched is the value of the header whose
name is specified by this attribute. The name match is performed
in a case insensitive manner.</p>
[RT Expr]
</td>
</tr>
<tr class="evenRow">
<td align="center">location</td>
<td>
<p>If not specified, a match between the variable and the value may
occur at any position within the variable string. If specified, the
match must occur at the specified location (either <code>start</code>
or <code>end</code>) of the variable string.</p>
[RT Expr]
</td>
</tr>
<tr class="oddRow">
<td align="center">name</td>
<td>
<p>The variable to be matched is the JSP bean specified by this
attribute, if <code>property</code> is not specified, or the value
of the specified property of this bean, if <code>property</code>
is specified.</p>
[RT Expr]
</td>
</tr>
<tr class="evenRow">
<td align="center">parameter</td>
<td>
<p>The variable to be matched is the first, or only, value of the
request parameter specified by this attribute.</p>
[RT Expr]
</td>
</tr>
<tr class="oddRow">
<td align="center">property</td>
<td>
<p>The variable to be matched is the property (of the bean specified
by the <code>name</code> attribute) specified by this attribute.
The property reference can be simple, nested, and/or indexed.</p>
[RT Expr]
</td>
</tr>
<tr class="evenRow">
<td align="center">scope</td>
<td>
<p>The bean scope within which to search for the bean named by the
<code>name</code> property, or "any scope" if not specified.</p>
[RT Expr]
</td>
</tr>
<tr class="oddRow">
<td align="center">value</td>
<td>
<p>The constant value which is checked for existence as a substring
of the specified variable.</p>
[Required]
[RT Expr]
</td>
</tr>
</table>
</div>
<p>
<a href="#top">Back to top</a>
</p>
<h3 id="notPresent">
<strong>notPresent</strong> -
Generate the nested body content of this tag if the specified
value is not present in this request.
</h3>
<div class="indent">
<p>Depending on which attribute is specified, this tag checks the
current request, and evaluates the nested body content of this tag
only if the specified value <strong>is not</strong> present. Only one
of the attributes may be used in one occurrence of this tag, unless
you use the <code>property</code> attribute, in which case the
<code>name</code> attribute is also required.</p>
<table class="tag-attributes">
<thead>
<tr>
<th class="attribute">Attribute Name</th>
<th>Description</th>
</tr>
</thead>
<tr class="evenRow">
<td align="center">cookie</td>
<td>
<p>Checks for the existence of a cookie with the specified name.</p>
[RT Expr]
</td>
</tr>
<tr class="oddRow">
<td align="center">header</td>
<td>
<p>Checks for the existence of an HTTP header with the specified
name. The name match is performed in a case insensitive manner.</p>
[RT Expr]
</td>
</tr>
<tr class="evenRow">
<td align="center">name</td>
<td>
<p>Checks for the existence of a JSP bean, in any scope, with the
specified name. If <code>property</code> is also specified, checks
for a non-null property value for the specified property.</p>
[RT Expr]
</td>
</tr>
<tr class="oddRow">
<td align="center">parameter</td>
<td>
<p>Checks for the existence of at least one occurrence of the
specified request parameter on this request, even if the parameter
value is a zero-length string.</p>
[RT Expr]
</td>
</tr>
<tr class="evenRow">
<td align="center">property</td>
<td>
<p>Checks for the existence of a non-null property value, returned
by a property getter method on the JSP bean (in any scope) that is
specified by the <code>name</code> attribute. Property references
can be simple, nested, and/or indexed.</p>
[RT Expr]
</td>
</tr>
<tr class="oddRow">
<td align="center">role</td>
<td>
<p>Checks whether the currently authenticated user (if any) has been
associated with the specified security role.</p>
[RT Expr]
</td>
</tr>
<tr class="evenRow">
<td align="center">scope</td>
<td>
<p>The bean scope within which to search for the bean named by the
<code>name</code> property, or "any scope" if not specified.</p>
[RT Expr]
</td>
</tr>
<tr class="oddRow">
<td align="center">user</td>
<td>
<p>Checks whether the currently authenticated user principal has the
specified name.</p>
[RT Expr]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -