1、在Maven项目的pom.xml的<dependencies></dependencies>标签中加入以下内容:
<!-- https://mvnrepository.com/artifact/javax.servlet/jstl -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/taglibs/standard -->
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.taglibs/taglibs-standard-impl -->
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-impl</artifactId>
<version>1.2.5</version>
</dependency>
2、在jsp头部加上jstl的引入标签:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
3、说明:jstl包为必须,standard和taglibs-standard-impl包二选一。
当然两个一起写进去也没问题,jsp默认选择用第一个standard jar包