一.jstl标签所需jar包为standard.jar和jstl.jar两个jar包
1.常用jsp头部
<%@ include file="/jsp/common/taglib.jsp"%>
<%@ page import="cn.com.sunrise.home.util.Constraint"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="tangs" uri="/WEB-INF/pagination.tld"%>
2.常用
<c:if test="${sessionScope.userAccount == 'admin'}">
</c:if>
<c:if test="${not empty sessionScope.userAccount}">
</c:if>
申明int rank =0;
<c:forEach var="type" items="${productTypeList}" varStatus="ls">
<c:if test="${ls.first}"></c:if>
<c:if test="${not ls.first}"></c:if>
<%rank++;%>
</c:forEach>
js中应用jstl
if(${flag}=='0'){
window.parent.parent.frames('iframeTop').location.replace('../jsp/top.jsp');
}
二STRUTS2的标签
<s:iterator value="hotNewsReviewList" status="status" id="hotNewsReviewList">
<li class="leftli"> <span class="leftbtxiao">时间:</span><s:property value="timeBuff"/><span class="leftbtxiao"> 姓名:</span> <s:property value="userName"/> </li>
<li class="leftli">评论<span class="leftbtxiao">:</span><s:property value="reviewContent" escape="false"/> </li>
</s:iterator>
<s:iterator value="kprList" status="status" id="kprList">
<s:if test="#kprList.clickTotalCount!=null">
<s:property value="clickTotalCount"/>
</s:if>
</s:iterator>