首页 > 代码库 > freemark与jstl对比

freemark与jstl对比

jstl的Index.jsp:

<%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%><%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html ng-app><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body><c:forEach var="l" items="${list}">    <c:if test="${l.getStr(‘name‘)==‘pinglun‘}">        <a href=http://www.mamicode.com/"/InfoAudit/comtModule/commentList" class="btn btn-primary btn-lg">用户评论</a>    </c:if>    <c:if test="${l.getStr(‘name‘)==‘tousu‘}">        <a href=http://www.mamicode.com/"/InfoAudit/comtModule/complainList" class="btn btn-primary btn-lg">用户投诉</a>    </c:if></c:forEach><c:forEach var="l" items="${list}">    <c:if test="${l.getStr(‘name‘)==‘pingluntousu-selall‘}">        <span class="btn btn-default" id="s_btn" ng-click="search(2)">全部区域</span>    </c:if></c:forEach></body></html>
View Code

freemark的index.html:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html ng-app><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body>     <#if  name == ‘pinglun‘}">        <a href=http://www.mamicode.com/"/InfoAudit/comtModule/commentList" class="btn btn-primary btn-lg">用户评论</a>    </#if>    <#if name == ‘tousu‘}">        <a href=http://www.mamicode.com/"/InfoAudit/comtModule/complainList" class="btn btn-primary btn-lg">用户投诉</a>    </#if>      <#if  name  == ‘pingluntousu-selall‘}">        <span class="btn btn-default" id="s_btn" ng-click="search(2)">全部区域</span>    </#if> </body></html>
View Code