uule 发表于 2013-1-26 15:23:54

[转]JSTL

如何判断空:
<c:if test="${orderform.name !=null}">
<td align="center" width="20%">    <c:choose><c:when test="${ empty news.issueNo}"></c:when><c:otherwise>   <span style="font-size:15px">issue : ${news.issueNo }</span></c:otherwise>    </c:choose></td><c:set var="log.logTitle" value="做一个截取字符串长度的测试"<c:choose><c:when test="${fn:length(log.logTitle) > 10}">   <c:out value="${fn:substring(log.logTitle, 0, 10)}" /></c:when><c:otherwise>   <c:out value="${log.logTitle}" /></c:otherwise></c:choose> 
<body>    <%    Set hashSet = new java.util.HashSet(); hashSet.add(1111); hashSet.add(222);request.getSession().setAttribute("set",hashSet);    %>    <script>    alert(${fn:length(sessionScope.set)});    </script></body> 
jsp拼装:

http://dl.iteye.com/upload/attachment/0068/1921/51a70121-de95-33cc-8dad-3f2f95466d3d.png
 

http://dl.iteye.com/upload/attachment/0068/1924/75acec64-9c2e-3f4e-83bf-fe3b786084f9.png
 
ForEach:

<div style="font-family: Arial; font-size: 14px; line-height: 26px;">${status.index}      输出行号,从0开始。
页: [1]
查看完整版本: [转]JSTL