浅尝JSTL标准标签库

 JSTL常用标签:替代在页面写java代码

<c:choose>,<c:when>,<c:otherwise>标签和if-esle判断语句类似

如:

<c:choose>

  <c:when test="${category.parent.parent.parent.id eq '1' }">
  <c:set var="categoryList1" value="${fnc:getCategoryList(site.id, category.parent.id, -1, null)}"></c:set>
  </c:when>
  <c:otherwise>
  <c:set var="categoryList1" value="${fnc:getCategoryList(site.id, category.parent.parent.id, -1, null)}"></c:set>
</c:otherwise>

</c:choose>


<c:if >标签和if判断语句类似

<c:forEach>标签和for增强型语句类似

<fmt:formatDate>格式化时间格式

如:

<c:if test="${category.module eq 'report'}">
<ul class="tab-content-ul">
<c:if test="${page.count>0}">
<c:forEach items="${page.list}" var="report">
<li >
<span class="pull-right" >
<fmt:formatDate value="${report.updateDate}" pattern="yyyy.MM.dd" />
<c:choose>
<c:when test="${fnc:store(report.id)}">
<a id="${report.id}" href="#" οnclick="cancelS'${report.id}')" style="color:#115a6f">
取消
</a>
</c:when>
<c:otherwise>
<a id="${report.id}" href="#" οnclick="shoucang('${report.id}')" style="color:#115a6f">
收藏 
</a>
</c:otherwise>
</c:choose>
</span>
<a href="#" οnclick="show('${report.resId}','${report.reportSuffix}')" title="${fns:abbr(report.reportName,100)}" style="color:#115a6f">
${fns:abbr(report.reportName,100)}
</a>
</li>
</c:forEach>
</c:if>
</ul>
</c:if>


常用JSTL标准标签如上所示,全面的JSTL标准标签库请查询下面的网站

http://elf8848.iteye.com/blog/245559

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值