jstl表達式配置
前段與後端動態交換數據用到了el表達式,但el表達式沒有流程控制,這時jstl就起到了補充作用,應爲他有<c:forEach>,<c:if>等控制語句,但使用jstl語句需要進行三個地方的配置:(這個只爲以後忘記了回頭來看)
一.web.xml中配置
<!-- jstl配置 -->
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>classpath*:/c.tld</taglib-location>
</taglib>
</jsp-config>
二.pom.xml中配置
在</dependencies>標籤裏配置如下兩個依賴包<!-- jstl配置信息 -->
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
三.在你用到jstl語句的jsp文件的頭部加上如下信息
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
完成了這三步才能使用jstl語句。