参考:http://www.runoob.com/jsp/jsp-jstl.html
核心标签格式化标签
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
JSTL格式化标签用
来格式化并输出文本、日期、时间、数字。引用格式化标签库的语法如下:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
时间转换
<fmt:formatDate value="${list.time}" pattern="yyyy-MM-dd HH:mm:ss"/>
<fmt:parseDate value="${k.key}-01" pattern="yyyy-MM-dd" var="firstDayWeek"/> <fmt:formatDate value="${firstDayWeek}" pattern="EEE" var="firstDayWeek"></fmt:formatDate>
if
<c:if test="${salary > 2000}">
<p>我的工资为: <c:out value="${salary}"/><p>
</c:if>
forEach
<c:forEach var="list" items="${list_area}">
<option aid="${list.id}">
${list.name }
</option>
</c:forEach>
取长度
<c:out value="${fn:length(kalendar)}"></c:out>