struts2 标签 怎样取出iterator的一行数据

<s:iteratorvalue="ptvList"var="item"status="st"><td><s:propertyvalue="ptvList.get(#st... <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}'>
这样却报空

请大神帮忙!!!
展开
 我来答
day忘不掉的痛
2015-08-14 · 知道合伙人数码行家
day忘不掉的痛
知道合伙人数码行家
采纳数:62651 获赞数:223917
本人担任公司网络部总经理多年,有充足的网络经验、互联网相关知识和资讯。

向TA提问 私信TA
展开全部
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>
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
禄岚o2
2014-08-24 · TA获得超过131个赞
知道小有建树答主
回答量:231
采纳率:0%
帮助的人:128万
展开全部
你是每次遍历出来每一个对象然后取对象中的属性吗?你进行判断的目的是什么?
更多追问追答
追问
先取出每个list的ptv对象的属性 点击一行属性 将ptv对象传出去 不知道怎样获取ptv对象
追答
遍历出来的每一个都是一个ptv对象,存放到了item中了,

//获得name,是否加#号不确定
//获得id,是否加#号不确定
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式