Problem description
An error is reported after importing the required dependencies and referencing the following core tag library. JSTL cannot be used.
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
Reason:
The dependency jar package is missing in the Tomcat project.
jstl 1.1 | jstl 1.2 | |
---|---|---|
依赖 jar 包 | standard.jar | taglibs-standard-impl-1.2.5.jar taglibs-standard-spec-1.2.5.jar |
solution
Option 1: Add these two dependencies
<!-- https://mvnrepository.com/artifact/org.apache.taglibs/taglibs-standard-spec -->
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-spec</artifactId>
<version>1.2.5</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>
<scope>runtime</scope>
</dependency>
Solution 2: manually import the jar package
you can find these two jar packages in the Tomcat \ webapps \ examples \ WEB-INF \ lib directory, and then copy them to the Lib directory of Tomcat or the Lib directory of the project to solve the problem</ font>
1. Copy to the Lib directory of Tomcat (once and for all)
2. Copy to the Lib directory of the project (only valid for this project)
About importing external jar packages in the project, you can see importing external jar packages in eclipse and idea
Similar Posts:
- [Solved] Can not find the tag library descriptor for “http://java.sun.com/jsp/jstl/core”
- [Solved] Jsonobject has no from object, idea has no Maven dependency, jsonobject Maven dependency package
- Can not find the tag library descriptor for “http://java.sun.com/jstl/core”
- Springboot always reports an error when importing JSP dependencies
- Springboot startup error start bean ‘eurekaautoserviceregistration’ NullPointerException
- Error during artifact deployment. See server log f
- Maven does not have a servlet (an error is reported after the servlet is created)
- [Solved] SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
- Tomcat 8.5 reports errors using JSTL [How to Solve]
- [Solved] SparkSQL Error: org.apache.hadoop.security.HadoopKerberosName.setRuleMechanism