If/elseif/else label:
Test attribute: The expression that determines whether the label content is displayed.
Iterator labelThe iterator label is used to iterate a set. The set can be Collection, Map, Enumeration, Iterator, or array. During the iteration process, iterator will temporarily push every object in the iteration into the value stack, so that the attributes and methods of the object can be directly accessed within the tag, and the execution is completed in the TAG body, objects at the top of the stack will be deleted, and new objects will be pushed in the second iteration.
Id attribute: If this attribute is specified, the iterative collection element is saved to OgnlContext. You can use this attribute value to reference the element in the collection. This attribute is almost unnecessary;
Value Attribute: Specifies the set of iterations. If not specified, the tag puts the objects at the top of the stack into a newly created List for iteration;
Status attribute: If this attribute is specified, an IteratorStatus instance named after the attribute value will be placed in OgnlContext. You can use this instance to obtain the status information during iteration;
The IteratorStatus class has the following methods:
Public int getCount (); returns the total number of elements of the current iteration;
Public int getIndex (); returns the index of the element of the current iteration;
Public boolean isEven (); determines whether the order of the current element is an even number;
Public boolean isOdd (); determines whether the order of the current element is odd;
Public boolean isFirst (); determines whether the current element is the first;
Public boolean isLast (); determines whether the current element is the last one.
These methods correspond to the count, index, even, odd, first, and last attributes respectively.
Append label: Used to merge different iterators, so that an iterator is transferred to the next iterator to continue iteration. Within the append tag, one or more param labels are used to specify the set to be iterated together. Its iteration order is the iterator after the first iterator iteration and then iteration.
Id attribute: After this attribute is specified, the combined iterator is saved to OgnlContext and can be referenced through the id attribute.
Merge tag: Similar to the append tag, but the iteration sequence is different: the merged merge iterator first iterates the first element in all iterators, and then iterates the second element in all iterators, and so on.
Generator label: The generator tag splits the values specified by the val Attribute Based on the separator specified by the separator attribute, generates an iterator, and pushes it to the top of the value stack. Inside the generator tag, you can use the iterator tag to retrieve the iterator at the top of the stack and iterate on each part after the split. When the generator label ends, the iterator at the top of the stack will be deleted.
Val attribute: Specifies the value to be parsed;
Seperator attribute: Specifies the delimiter used to parse the val attribute;
Count attribute: specifies the number of available elements in the generated iterator;
Converter attribute: Specifies a converter to convert parsed strings to objects. The Converter is a class that implements the org. apache. struts2.util. IteratorGenerator. Converter interface and can be instantiated and referenced using bean labels;
Id attribute: If this attribute is specified, the generated iterator saves the property value as the key to the pageContext object. This is different from other labels.
Subset tag: The subset tag is used to intercept a subset of an iterator;
Source attribute: Specifies the source set. If not specified, the stack top object of the value stack is used as the source set;
Start attribute: Specifies the subsets starting from the first element of the source set, and the index starts from 0;
Count attribute: specifies the number of truncated elements;
Decider attribute: Specifies a Decider object to determine whether an element should be contained in a subset. Decider is a class that implements the org. apache. struts2.util. SubsetIteratorFilter. Decider interface. It can be instantiated and referenced using bean labels;
Id attribute: If this attribute is specified, the truncated subset is saved as the key in the pageContext object.
Sort tag: The sort tag sorts the set based on the comparator specified by the comparator attribute, and pushes the sorted iterator to the top of the value stack. Inside the sort tag, you can use the iterator tag to retrieve the iterator at the top of the stack and iterate the sorted elements. When the sort Tag ends, the iterator at the top of the stack will be deleted;
Source attribute: Specifies the set to be sorted. If this parameter is not specified, the objects at the top of the stack are used as the sorting set;
Comparator attribute: Specifies the comparator used. The Comparator class is a class that implements the java. util. Comparator interface. bean labels can be used for instantiation and reference;
Id attribute: If this attribute is specified, the sorted iterator saves the attribute value as the key to the pageContext object.
|