Home > Web Front-end > JS Tutorial > body text

Summary of common methods of struts2 tags

一个新手
Release: 2017-09-22 09:44:57
Original
1265 people have browsed it

1. Find whether there is a value equal to id in a list

<s:set name="flag" value="false" />
<s:iterator value="courses" id="item">
    <s:if test="${item==id}">
        <s:set name="flag" value="true" />
    </s:if>
</s:iterator>
Copy after login

2. Implement addition

Pure digital addition

<s:property value="1+2"/>
<s:property value="%{1+2}"/>
Copy after login

Addition with variables (the variables need to be Numeric type, if one of them is a string, it is string concatenation)

<s:property value="msgPK+msgPK"/>
<s:property value="%{msgPK+msgPK}"/>
<s:property value="#stat.index+1"/>
Copy after login

3. Get the subscript of iterator

<s:iterator value="prVoteQuestionAnswerList" id="class" status="num">
第<s:property value="#num.index+1"/>题
</s:iterator>
Copy after login

The above is the detailed content of Summary of common methods of struts2 tags. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template