EL(Expression Language)
get value from a List(java.util.List)
${alist[index]}
get value from a Map(java.util.Map) or get value from a JavaBean( anObject.getProperty())
${amap["key"]}, ${amap.key}
scope: page, request, session, application, param, paramValues, header, headerValues, cookie
jstl
c:out
<c:out value="100"/>
c:set var value scope{session, cookie}
set var as value in scope
c:if
save the test result to var
<c:if test="${status.totalVisits == 1000000}" var="visits">
You are the millionth visitor to our site! Congratulations!
</c:if>
c:forEach
<c:forEach var="x" begin="0" end="10" step="2">
<c:out value="${x}"/>
</c:forEach>
<c:forEach items="${entryList}" var="blogEntry"> iterator
<c:out value="blogEntry.key"/>
</c:forEach>
<c:forEach items="${entryList}" var="blogEntry" varStatus="status">
varStatus:
current getCurrent() 当前这次迭代的(集合中的)项
index getIndex() 当前这次迭代从 0 开始的迭代索引
count getCount() 当前这次迭代从 1 开始的迭代计数
first isFirst() 用来表明当前这轮迭代是否为第一次迭代的标志
last isLast() 用来表明当前这轮迭代是否为最后一次迭代的标志
begin getBegin() begin 属性值
end getEnd() end 属性值
step getStep() step 属性值
fmt
formatDate
value=""
type="date|time|both"
dateStyle="full|long|medium|short|default"
timeStyle="full|long|medium|short|default"
pattern ="yyyy-MM-dd HH-mm-ss"
<fmt:setBundle basename="status"/>
<fmt:message key="${result.status}"/>