Properties for Struts logic tags
This documentation describes the attributes for the elements that are defined in the Struts logic tag library. By default, the name of each of these elements has a logic: prefix.
Each Struts element has a number of properties that you can set by using the element's Properties view. Use this table of properties while working with the element's Properties view, to look up properties for which you want additional detail. Some properties have the same name but different usage in different elements. The properties are listed in alphabetical order.
Properties In element Description anchor redirect Specifies an optional anchor tag (xxx) to be added as #xxx to the generated hyperlink. collection iterate Specifies a run-time expression that evaluates to a collection (conforming to particular requirements) to be iterated over. cookie equal, greaterEqual, greaterThan, lessEqual, lessThan, notEqual, notPresent, present Specifies the name of a cookie whose value is to be compared with the value of the value attribute. forward redirect Specifies the logical name of a global ActionForward class that contains the actual content-relative URI of the destination of this redirect element. You can modify the URI modified dynamically by including query parameters, as described in the tag description. You must specify exactly one of the following attributes: forward, href, linkName, or page. header equal, greaterEqual, greaterThan, lessEqual, lessThan, notEqual, notMatch, notPresent, present Specifies the name of the header whose value is to be compared. The name match is performed in a case-insensitive manner. href redirect Specifies the URL to which this element will transfer control. You can modify the URL dynamically by the including query parameters as described in the tag description. You must specify exactly one of the following attributes: forward, href, linkName, or page. id iterate Specifies the name of a page scope JSP bean that will contain the current element of the collection on each iteration, if it is not null. [Required] indexId iterate Specifies the name of a page scope JSP bean that will contain the current index of the collection on each iteration. length iterate Specifies the maximum number of entries (from the underlying collection) to be iterated through on this page. This can be either an integer that directly expresses the desired value, or the name of a JSP bean (in any scope) of type java.lang.Integer that defines the desired value. By default, the number of iterations performed is not limited. message messagesNotPresent, messagesPresent If set to true, retrieves the request scope bean from the Globals.MESSAGE_KEY constant string and ignores any value assigned to the name attribute. By default the tag retrieves from the Globals.ERROR_KEY constant string the request scope bean over which it will iterate. name equal, greaterEqual, greaterThan, lessEqual, lessThan, notEqual, notMatch, notPresent, present Specifies a JSP bean as the variable to be compared, if you omit property, or the value of the specified property of this bean, if you specify property. name forward Specifies the logical name of the global ActionForward entry that identifies the destination, and forwarding approach, to be used. Note: Forwarding to tiles definitions is not supported from this tag. You should forward to them from an action. [Required]
name iterate Specifies the name of the JSP bean that contains the collection to be iterated (if you omit property), or the JSP bean whose property getter returns the collection to be iterated (if you specify property). name match, notMatch Specifies the variable to be matched is the JSP bean specified by this attribute, if you omit property, or the value of the specified property of this bean, if you specify property. name messagesNotPresent, messagesPresent Specifies the parameter key to retrieve the message from request scope. name notPresent, present Checks for the existence of a JSP bean, in any scope, with the specified name. If you also specify property, name checks for a nonnull property value for the specified property. name redirect Specifies the name of a JSP bean that contains a Map class that represents the query parameters (if you omit property), or a JSP bean whose property getter is called to return a Map (if you specify property). offset iterate Specifies the zero-relative index of the starting point from which entries from the underlying collection will be iterated. This can be either an integer that directly expresses the desired value or the name of a JSP bean (in any scope) of type java.lang.Integer that defines the desired value. The default value is zero, which means that the collection will be iterated from the beginning. page redirect Specifies the context-relative path (beginning with a / character) to which this hyperlink will transfer control if activated. You can modify the hyperlink dynamically by including query parameters as described in the tag description. You must specify exactly one of the following attributes: forward, href, linkName, or page. parameter equal, greaterEqual, greaterThan, lessEqual, lessThan, notEqual, notMatch, notPresent, present Specifies the name of the URL request parameter whose value is to be compared with the value of the value attribute. paramId redirect Specifies the name of the request parameter that will be added dynamically to the generated hyperlink. The corresponding value is defined by the paramName and (optional) paramProperty attributes and is optionally scoped by the paramScope attribute. paramName redirect Specifies the name of a JSP bean that is a String containing the value for the request parameter named by paramId (if you omit paramProperty), or a JSP bean whose property getter is called to return a String (if you specify paramProperty). The JSP bean is constrained to the bean scope specified by the paramScope property, if it is specified. paramProperty redirect Specifies the name of a property of the bean specified by the paramName attribute, whose return value must be a String containing the value of the request parameter (named by the paramId attribute) that will be added dynamically to this hyperlink. paramScope redirect Specifies the scope within which to search for the bean specified by the paramName attribute. By default, all scopes are searched. property empty, equal, iterate, messagesNotPresent, messagesPresent, notEqual, notPresent, present, redirect Specifies the name of the property (of the bean specified by the name attribute) whose value is to be compared. The property reference can be simple, nested, or indexed. role notPresent, present Checks whether the currently authenticated user (if any) has been associated with any of the specified security roles. To specify multiple roles, separate the role names with commas. scope equal, greaterEqual, greaterThan, lessEqual, lessThan, notEqual, notMatch, notPresent, present Specifies the bean scope within which to search for the bean named by the name property. The default is to use any scope. transaction redirect If set to true, includes the current transaction control token in the generated URL for this element. type iterate Specifies the fully qualified Java class name of the element to be exposed through the JSP bean named from the id attribute. By default, no type conversions are performed. Note: The actual elements of the collection must be assignment-compatible with this class, or a request time ClassCastException error will occur.
user notPresent, present Checks whether the currently authenticated user has the specified name. value equal, greaterEqual, greaterThan, lessEqual, lessThan, notEqual Specifies the constant value to which the variable, specified by other attributes of this tag, will be compared.
Related tasks
Adding Struts tags to a JSP file
Related reference
Feedback
Properties for Struts bean tags
Properties for Struts tiles tags
Properties for Struts HTML tags
Properties for Struts nested tags
Properties for Struts tags