<s:iterator value="ptvList" var="item" status="st">
<td><s:property value="ptvList.get(#st.index).id.name" /></td>
这样可以打印出数据
<s:if test='%{<s:property value="ptvList.get(#st.index)" /> != null}'>
这样却报空
请大神帮忙!!!
struts2 标签 怎样取出iterator的一行数据
答案:2 悬赏:20 手机版
解决时间 2021-02-06 19:45
- 提问者网友:wodetian
- 2021-02-06 09:11
最佳答案
- 五星知识达人网友:刀戟声无边
- 2021-02-06 09:38
struts2的iterator标签有begin和end属性
<tag>
<description><![CDATA[Iterate over a iterable value]]></description>
<name>iterator</name>
<tag-class>org.apache.struts2.views.jsp.IteratorTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[if specified the iteration will start on that index]]></description>
<name>begin</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description><![CDATA[if specified the iteration will end on that index(inclusive)]]></description>
<name>end</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description><![CDATA[Deprecated. Use 'var' instead]]></description>
<name>id</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description><![CDATA[If specified, an instanceof IteratorStatus will be pushed into stack upon each iteration]]></description>
<name>status</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description><![CDATA[if specified the iteration index will be increased by this value on each iteration. It can be a negative value, in which case 'begin' must be greater than 'end']]></description>
<name>step</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description><![CDATA[the iteratable source to iterate over, else an the object itself will be put into a newly created List]]></description>
<name>value</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description><![CDATA[Name used to reference the value pushed into the Value Stack]]></description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<dynamic-attributes>false</dynamic-attributes>
</tag>
struts-tag.tld文件中的代码
<tag>
<name>iterator</name>
<tag-class>org.apache.struts2.views.jsp.IteratorTag</tag-class>
<body-content>JSP</body-content>
<description><![CDATA[Iterate over a iterable value]]></description>
<attribute>
<name>id</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description><![CDATA[id for referencing element. For UI and form tags it will be used as HTML id attribute]]></description>
</attribute>
<attribute>
<name>status</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description><![CDATA[If specified, an instanceof IteratorStatus will be pushed into stack upon each iteration]]></description>
</attribute>
<attribute>
<name>value</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description><![CDATA[the iteratable source to iterate over, else an the object itself will be put into a newly created List]]></description>
</attribute>
</tag>
<tag>
<description><![CDATA[Iterate over a iterable value]]></description>
<name>iterator</name>
<tag-class>org.apache.struts2.views.jsp.IteratorTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[if specified the iteration will start on that index]]></description>
<name>begin</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description><![CDATA[if specified the iteration will end on that index(inclusive)]]></description>
<name>end</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description><![CDATA[Deprecated. Use 'var' instead]]></description>
<name>id</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description><![CDATA[If specified, an instanceof IteratorStatus will be pushed into stack upon each iteration]]></description>
<name>status</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description><![CDATA[if specified the iteration index will be increased by this value on each iteration. It can be a negative value, in which case 'begin' must be greater than 'end']]></description>
<name>step</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description><![CDATA[the iteratable source to iterate over, else an the object itself will be put into a newly created List]]></description>
<name>value</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description><![CDATA[Name used to reference the value pushed into the Value Stack]]></description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<dynamic-attributes>false</dynamic-attributes>
</tag>
struts-tag.tld文件中的代码
<tag>
<name>iterator</name>
<tag-class>org.apache.struts2.views.jsp.IteratorTag</tag-class>
<body-content>JSP</body-content>
<description><![CDATA[Iterate over a iterable value]]></description>
<attribute>
<name>id</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description><![CDATA[id for referencing element. For UI and form tags it will be used as HTML id attribute]]></description>
</attribute>
<attribute>
<name>status</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description><![CDATA[If specified, an instanceof IteratorStatus will be pushed into stack upon each iteration]]></description>
</attribute>
<attribute>
<name>value</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description><![CDATA[the iteratable source to iterate over, else an the object itself will be put into a newly created List]]></description>
</attribute>
</tag>
全部回答
- 1楼网友:妄饮晩冬酒
- 2021-02-06 10:46
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯
什么是不动产,通俗点解释。 |
石头湾村地址在哪,我要去那里办事 |
西昌市人民医院做唐氏筛查需要预约吗 |
广州哪里有做微信公众号开发的 |
第一天去大企业的办公室上班,请问该注意些什么? |
国际收支逆差时,可以采用()。A.紧的财政政策B.松 |
常州市精迪阀门控制有限公司在哪里啊,我有事要去 |
豪创灯饰这个地址在什么地方,我要处理点事 |
正方形一边上任一点到这个正方形两条对角线的 |
阴历怎么看 ? |