In Java web development with JSP and JSTL, you may get the following runtime error when the application is running:

Message: Unable to find taglib [c] for URI: [jakarta.tags.core]

Description: The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception:

org.apache.jasper.JasperException: Unable to find taglib [c] for URI: [jakarta.tags.core]
	org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:54)
	org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:301)
	org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:82)
	...

Although you specify the correct taglib directive in your JSP page:

<%@ taglib prefix="c" uri="jakarta.tags.core" %>

That error means the Java runtime could not find any classes that are responsible to process the specified JSTL tags (core tags, format tags, function tags, etc).

So to solve this error, check your project’s dependency declaration to make sure it does include dependencies for JSTL APIs and JSTL implementation, something like this:

<dependency>
	<groupId>jakarta.servlet.jsp.jstl</groupId>
	<artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
	<version>3.0.0</version>
</dependency>  
<dependency>
	<groupId>org.glassfish.web</groupId>
	<artifactId>jakarta.servlet.jsp.jstl</artifactId>
	<version>3.0.1</version>
</dependency>

Restart the server and test your application again, the error Unable to find taglib… will be gone.

 

Learn more:


About the Author:

is certified Java programmer (SCJP and SCWCD). He started programming with Java in the time of Java 1.4 and has been falling in love with Java since then. Make friend with him on Facebook and watch his Java videos you YouTube.



Add comment