Class AppendIterator
- All Implemented Interfaces:
- Param.UnnamedParametric
Component for AppendIteratorTag, which jobs is to append iterators to form an appended iterator whereby entries goes from one iterator to another after each respective iterator is exhausted of entries.
For example, if there are 3 iterator appended (each iterator has 3 entries), the following will be how the appended iterator entries will be arranged:
- First Entry of the First Iterator
- Second Entry of the First Iterator
- Third Entry of the First Iterator
- First Entry of the Second Iterator
- Second Entry of the Second Iterator
- Third Entry of the Second Iterator
- First Entry of the Third Iterator
- Second Entry of the Third Iterator
- Third Entry of the Third ITerator
- var (String) - the name of which if supplied will have the resultant appended iterator stored under in the stack's context
public class AppendIteratorTagAction extends ActionSupport {
private List myList1; private List myList2; private List myList3;
public String execute() throws Exception {
myList1 = new ArrayList(); myList1.add("1"); myList1.add("2"); myList1.add("3");
myList2 = new ArrayList(); myList2.add("a"); myList2.add("b"); myList2.add("c");
myList3 = new ArrayList(); myList3.add("A"); myList3.add("B"); myList3.add("C");
return "done"; }
public List getMyList1() { return myList1; } public List getMyList2() { return myList2; } public List getMyList3() { return myList3; } }
<s:append var="myAppendIterator"> <s:param value="%{myList1}" /> <s:param value="%{myList2}" /> <s:param value="%{myList3}" /> </s:append> <s:iterator value="%{#myAppendIterator}"> <s:property /> </s:iterator>
- See Also:
- 
Field SummaryFields inherited from class org.apache.struts2.components.ContextBeanvarFields inherited from class org.apache.struts2.components.ComponentactionMapper, attributes, COMPONENT_STACK, devMode, escapeHtmlBody, performClearTagStateForTagPoolingServers, stack, standardAttributesMap, throwExceptionOnELFailure
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddParameter(Object value) Adds the given value as a parameter to the outer tag.booleanCallback for the end tag of this component.voidbooleanCallback for the start tag of this component.Methods inherited from class org.apache.struts2.components.ContextBeangetVar, putInContextMethods inherited from class org.apache.struts2.components.ComponentaddAllAttributes, addParameter, completeExpression, copyAttributes, determineActionURL, determineNamespace, end, escapeHtmlBody, fieldError, findAncestor, findString, findString, findValue, findValue, findValue, getAttributes, getComponentStack, getNamespace, getPerformClearTagStateForTagPoolingServers, getStack, getStandardAttributes, isAcceptableExpression, isValidTagAttribute, popComponentStack, setActionMapper, setDevMode, setEscapeHtmlBody, setNotExcludedAcceptedPatterns, setPerformClearTagStateForTagPoolingServers, setThrowExceptionsOnELFailure, setUrlHelper, stripExpression, toString, usesBody
- 
Constructor Details- 
AppendIterator
 
- 
- 
Method Details- 
startDescription copied from class:ComponentCallback for the start tag of this component. Should the body be evaluated?
- 
endDescription copied from class:ComponentCallback for the end tag of this component. Should the body be evaluated again?
 NOTE: will pop component stack.
- 
addParameterDescription copied from interface:Param.UnnamedParametricAdds the given value as a parameter to the outer tag.- Specified by:
- addParameterin interface- Param.UnnamedParametric
- Parameters:
- value- the value
 
- 
setVar- Overrides:
- setVarin class- ContextBean
 
 
-