org.apache.struts2.components
类 AppendIterator
java.lang.Object
org.apache.struts2.components.Component
org.apache.struts2.components.ContextBean
org.apache.struts2.components.AppendIterator
- 所有已实现的接口:
- Param.UnnamedParametric
public class AppendIterator
- extends ContextBean
- implements 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
- id (String) - the id 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>
- 另请参见:
AppendIteratorFilter
,
AppendIteratorTag
从类 org.apache.struts2.components.Component 继承的方法 |
addAllParameters, addParameter, altSyntax, copyParams, getComponentStack, getParameters, getStack, setActionMapper, setThrowExceptionsOnELFailure, setUrlHelper, usesBody |
AppendIterator
public AppendIterator(com.opensymphony.xwork2.util.ValueStack stack)
start
public boolean start(Writer writer)
- 从类
Component
复制的描述
- Callback for the start tag of this component.
Should the body be evaluated?
- 覆盖:
- 类
Component
中的 start
- 参数:
writer
- the output writer.
- 返回:
- true if the body should be evaluated
end
public boolean end(Writer writer,
String body)
- 从类
Component
复制的描述
- Callback for the end tag of this component.
Should the body be evaluated again?
NOTE: will pop component stack.
- 覆盖:
- 类
Component
中的 end
- 参数:
writer
- the output writer.body
- the rendered body.
- 返回:
- true if the body should be evaluated again
addParameter
public void addParameter(Object value)
- 从接口
Param.UnnamedParametric
复制的描述
- Adds the given value as a parameter to the outer tag.
- 指定者:
- 接口
Param.UnnamedParametric
中的 addParameter
- 参数:
value
- the value
setVar
public void setVar(String var)
- 覆盖:
- 类
ContextBean
中的 setVar