标签:
函数描写叙述
假设是String类型,返回值是String中的 字符数。
用參数after字符串替换參数string中全部出现參数before字符串的地方,并返回替换后的结果
<c:choose>
<c:when test="${fn:length(audit_message)>0}">
<c:forEach var="message" items="${audit_message}" >
<li>
<span>
<strong> ${message.title }</strong>
</span>
</li>
</c:forEach>
<c:if test="${audit_message_more}">
<li>
<div class="desc clearfix">
<a href="<%=basePath %>manage/message/list.action">很多其它>></a>
</div>
</li>
</c:if>
</c:when>
<c:otherwise>
<img src="imgs/no_data.png" alt="" class="noData"/>
</c:otherwise>
</c:choose>
JSTL推断字符是否为空
替换回车符:<span>中显示内容含有回车符是不会回车的,全部往往须要把回车符替换为<br>才干正常显示回车效果。
错误:${fn: replace(source,‘\n‘,‘<br>‘)} 这样的方法会报错的
正确:<% request.setAttribute("vEnter", "\n"); %>
${fn:replace(source, vEnter, "<br>")
版权声明:本文博客原创文章,博客,未经同意,不得转载。
[JSP][JSTL]页面调用函数--它${fn:}内置函数、是推断字符串是空的、更换车厢
标签:
原文地址:http://www.cnblogs.com/yxwkf/p/4612846.html