jsp 使用 jstl,访问页面之后报错,如上图所示。我的 Tomcat 版本是 10.0,导入的 jstl 是 javax.servlet 下的,应该导入以下几个包:
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.30</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jakarta.servlet.jsp.jstl</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-spec</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-impl</artifactId>
<version>1.2.5</version>
</dependency>
jstl 导入的是 org.glassfish.web 下的,标签库用的是 org.apache.taglibs 下的。web.xml 也不需要配置什么。jsp 页面的最顶部要加上:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
标签:tagext,taglibs,JSTL,报错,jstl,org,jsp,servlet,javax
From: https://www.cnblogs.com/Enziandom/p/16826798.html