1. I used jstl labels all the time, and later I started to use some struts2 labels. After all, some struts2 labels are more convenient to use.
The struts2 label and jstl label are often used in projects, such as custom tags or cyclic tags.
1. Use struts2 in jstl
<C: forEach var = "ee" items = "$ {requestScope. serviceList}">
Jstl: <c: out value = "$ {ee. id}"> </c: out>
El: $ {ee. id}
Struts2: <s: property value = "Ettr. ee. id"/>
</C: forEach>
When you use the struts2 label to retrieve the variables of the jstl label, you can set the scope from the scope
If not, use Ettr to set the value.
2. Get the value from the jstl tag
<C: set var = "ctime" value = "$ {el. createtime}" scope = "request"/>
<C: set var = "ctime2" value = "$ {el. createtime}"/>
<S: property value = "# request. ctime"/>
<S: property value = "Ettr. ctime2"/>
3. Use jstl in the struts2 label
<S: iterator value = "# request. serviceList" id = "bs">
Struts2: <s: property value = "# bs. keyid"/>
El: $ {bs. keyid}
Jstl: <c: out value = "$ {bs. keyid}"> </c: out>
</S: iterator>
4. values from the struts2 tag
<! -- Number type -->
<S: set name = "pp" value = "11"> </s: set>
Struts2: <s: property value = "# pp"/>
El: $ {pp}
Jstl: <c: out value = "$ {pp}"> </c: out>
<! -- String type -->
<S: set name = "pp2" value = "'abc'" scope = "request"> </s: set>
Struts2: <s: property value = "# request. pp2"/>
El: $ {pp2}
Jstl: <c: out value = "$ {pp2}"> </c: out>
Author: pcenshao