Struts 2 generator tag: split string







Example

<body>
  <h3>使用generator标签拆分一个字符串</h3>
  <s:generator val="'Java,C#,Javaweb'" separator=",">
    <s:iterator>
      <s:property/><br>
    </s:iterator>
  </s:generator>
  <h3>设置count的属性来确定迭代器中可用元素的数量</h3>
  <!--由于count属性设置为2,因此生成的迭代器中只有2个元素可用-->
  <s:generator separator="," val="'Java,C#,Javaweb'" count="2">
    <s:iterator>
      <s:property/><br>
    </s:iterator>
  </s:generator>
</body>
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>