| |||||||
FRAMES NO FRAMES |
<%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic" %>
<anyxmlelement xmlns:logic="http://struts.apache.org/tags-logic" />
Note: Some of the features in this taglib are also available in the JavaServer Pages Standard Tag Library (JSTL). The Struts team encourages the use of the standard tags over the Struts specific tags when possible.
This tag library contains tags that are useful in managing conditional generation of output text, looping over object collections for repetitive generation of output text, and application flow management.
For tags that do value comparisons (
equal
,greaterEqual
,greaterThan
,lessEqual
,lessThan
,notEqual
), the following rules apply:
double
or a long
, it is assumed that the ultimate comparison will be numeric (either floating point or integer). Otherwise, a String comparison will be performed.cookie
, header
, name
, parameter
, property
) present on this tag. It will be converted to the appropriate type for the comparison, as determined above.true
result.For tags that do substring matching (match
, notMatch
), the following rules apply:
cookie
, header
, name
, parameter
, property
) present on this tag. The variable is converted to a String, if necessary.location
attribute, as follows: at the beginning (if location is set to start
), at the end (if location is set to end
), or anywhere (if location is not specified).Many of the tags in this tag library will throw a JspException
at runtime when they are utilized incorrectly (such as when you specify an invalid combination of tag attributes). JSP allows you to declare an "error page" in the <%@ page %>
directive. If you wish to process the actual exception that caused the problem, it is passed to the error page as a request attribute under key org.apache.struts.action.EXCEPTION
.
Tag Library Information | |
Display Name | None |
Version | 1.3 |
Short Name | logic |
URI | http://struts.apache.org/tags-logic |
Tag Summary | |
empty | Evaluate the nested body content of this tag if the requested variable is either null or an empty string. This tag evaluates its nested body content only if the specified value is either absent (i.e. JSTL: The equivalent JSTL tag is <c:if> using the
|
equal | Evaluate the nested body content of this tag if the requested variable is equal to the specified value. 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 equal. |
greaterEqual | Evaluate the nested body content of this tag if the requested variable is greater than or equal to the specified value. 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 is greater than or equal to the value. |
greaterThan | Evaluate the nested body content of this tag if the requested variable is greater than the specified value. 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 is greater than the value. |
iterate | Repeat the nested body content of this tag over a specified collection. Repeats the nested body content of this tag once for every element of the specified collection, which must be a
If the collection you are iterating over can contain |
lessEqual | Evaluate the nested body content of this tag if the requested variable is less than or equal to the specified value. 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 is less than or equal to the value. |
lessThan | Evaluate the nested body content of this tag if the requested variable is less than the specified value. 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 is less than the value. |
match | Evaluate the nested body content of this tag if the specified value is an appropriate substring of the requested variable. Matches the variable specified by one of the selector attributes (as a String) against the specified constant value. If the value is a substring (appropriately limited by the |
notEmpty | 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). This tag evaluates its nested body content only if the specified value is present (i.e. not JSTL: The equivalent JSTL tag is <c:if> using the |
notEqual | Evaluate the nested body content of this tag if the requested variable is not equal to the specified value. 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 not equal. |
notMatch | Evaluate the nested body content of this tag if the specified value is not an appropriate substring of the requested variable. 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 |
notPresent | Generate the nested body content of this tag if the specified value is not present in this request. 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 is not present. Only one of the attributes may be used in one occurrence of this tag. |
present | Generate the nested body content of this tag if the specified value is present in this request. 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 is present. Only one of the attributes may be used in one occurrence of this tag. |
redirect | Render an HTTP Redirect Performs an The base URL for this redirect is calculated based on the href Normally, the redirect you specify will be left unchanged (other than URL rewriting if necessary). However, there are two ways you can append one or more dynamically defined query parameters to the hyperlink -- specify a single parameter with the To specify a single parameter, use the If you prefer to specify a As the Additionally, you can request that the current transaction control token, if any, be included in the generated hyperlink by setting the |
| |||||||
FRAMES NO FRAMES |