关于JSTL标签使用总结(2)

关于JSTL标签使用总结(2)

Posted by wenfengSAT on March 14, 2018

关于JSTL标签使用总结(2) 实用时的总结

<fmt:formatDate value="${share.shareDate}" pattern="yyyy-MM-dd HH:mm:ss" />


<c:if test="${ newBlogs == null}">
	<li><a href="#" style="color:red;">最近没有发表内容!</a></li>
</c:if>
<c:forEach items="${newBlogs}" var="blog">
<li><i class="fa-li fa fa-hand-o-right"></i>
	<a href="<%=path%>/blog/blogDetail/${blog.code}">${blog.title}</a>
</li>
</c:forEach>


<select name="classify" id="noteTag" lay-filter="noteTag">
<option value="">请选择标签</option>
<c:forEach items="${tags}" var="tag">
	 <option value="${tag.id}">${tag.name}</option>
</c:forEach>
</select>


<c:choose>  
	<c:when test='${fn:contains(user.headPic,"http")}'>  
		<img src="${user.headPic }" width="45" height="45">    
	</c:when>  
	<c:otherwise>  
		<img src="<%=path%>/${user.headPic }" width="45" height="45">
	 </c:otherwise>  
</c:choose> 


<c:if test="${user.count <= 30}">潜水</c:if>  
<c:if test="${user.count > 30} && ${user.count <= 70}">冒泡</c:if>
<c:if test="${user.count > 70} && ${user.count <= 100}">吐槽</c:if>
<c:if test="${user.count > 100} && ${user.count <= 300}">活跃</c:if>
<c:if test="${user.count > 300} && ${user.count <= 500}">话痨</c:if>
<c:if test="${user.count > 500}">传说</c:if>


<c:if test="${ newShares == null}">
	<li><a href="#" style="color:red;">最近没有分享的内容!</a></li>
</c:if>

<s:set var="containerV" value="#obj.icId+'/'+#obj.icRev"/>
<tr class="${containerV == container ? 'light' : '' }"></tr>
<c:if test="${containerV == container}">true</c:if>