<c:if test="${empty var1}">
var1 is empty or null.
</c:if>
<c:if test="${not empty var1}">
var1 is NOT empty or null.
</c:if>
<c:if test="${fn:length(list)==0}">数组为空</c:if>
<c:choose>
<c:when test="${empty var1}">
var1 is empty or null.
</c:when>
<c:otherwise>
var1 is NOT empty or null.
</c:otherwise>
</c:choose>
<c:forEach items="${vectors}" var="vector">
<c:out value="${vector}"/>
</c:forEach>
<c:import url="http://www.url.com/edit.js" var="newsfeed"/>
重定向
<c:redirect url="http://www.yourname.com/login.jsp"/>
重定向带参数
<c:redirect url="login.jsp">
<c:param name="id" value="888"/>
</c:redirect>
当要存取的属性名称中包含一些特殊字符,如.或?等并非字母或数字的符号,就一定要使用 []。
例如:${user.My-Name}应当改为${user["My-Name"] }
<%@ taglib prefix="fmt" http://java.sun.com/jsp/jstl/fmt">http://java.sun.com/jsp/jstl/fmt" %>
1)格式化日期<fmt:formatDate value=“” pattern=“yyyy-MM-dd HH:mm:ss”/>
<fmt:formatDate value="${date }" pattern="yyyy-MM-dd"/>
<fmt:formatDate value="${date }" pattern="yyyy年MM月dd日"/>
2) 格式化数字<fmt:formatNumber value="${number}" pattern="###,###.##" />
var1 is empty or null.
</c:if>
<c:if test="${not empty var1}">
var1 is NOT empty or null.
</c:if>
<c:if test="${fn:length(list)==0}">数组为空</c:if>
<c:choose>
<c:when test="${empty var1}">
var1 is empty or null.
</c:when>
<c:otherwise>
var1 is NOT empty or null.
</c:otherwise>
</c:choose>
<c:forEach items="${vectors}" var="vector">
<c:out value="${vector}"/>
</c:forEach>
<c:import url="http://www.url.com/edit.js" var="newsfeed"/>
重定向
<c:redirect url="http://www.yourname.com/login.jsp"/>
重定向带参数
<c:redirect url="login.jsp">
<c:param name="id" value="888"/>
</c:redirect>
当要存取的属性名称中包含一些特殊字符,如.或?等并非字母或数字的符号,就一定要使用 []。
例如:${user.My-Name}应当改为${user["My-Name"] }
<%@ taglib prefix="fmt" http://java.sun.com/jsp/jstl/fmt">http://java.sun.com/jsp/jstl/fmt" %>
1)格式化日期<fmt:formatDate value=“” pattern=“yyyy-MM-dd HH:mm:ss”/>
<fmt:formatDate value="${date }" pattern="yyyy-MM-dd"/>
<fmt:formatDate value="${date }" pattern="yyyy年MM月dd日"/>
2) 格式化数字<fmt:formatNumber value="${number}" pattern="###,###.##" />