TagLibraryValidator error while using JSTL Tags

133 Views Asked by At

I have been practicing JSTL tags in EclipseIDE but the code is throwing an HTTP Status 500 error.

I am trying to integrate JSTL tags into my .jsp files, but I am facing a TagLibraryValidator error. I am trying to just use the jstl tags in .jsp file and it is a basic program

<c:set var ="name" value="User"></c:set>
<c:out value="${name}"></c:out>

I have included <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> But it is giving HTTP Status 500-Intenal Server Error.

I have tried every possible solution available on the internet. These are all the solutions I have tried that were mentioned by various people on stackoverflow, youtube and other google Websites...

I have used jst-1.2 and pasted it in lib folder, jakarta.activation-2.0.0, jakarta.el-api-4.0.0, jakarta.servlet.jsp.jstl-2.0.0 and also 3.0.0, jakarta.servlet.jsp.jstl-api-2.0.0 ,jakarta.servlet.jsp-api-3.1.1, jakarta.servlet-api5.0.0, jakarta.xml.bind-api-3.0.0 I have tried to include them at various locations like mentioned by the online sources and tried various files etc.etc.

Of course not at a time but one after other but all gave **java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator ** and some other errors like cannot invoke getAttributes() error.

Please help me with the proper version, inclusion of jar files.

P.S. I am using Eclipse IDE,Dynamic Wen Module 6.0, Apache Tomcat Server 10.1``

1

There are 1 best solutions below

8
On

Tomcat 10.1 uses jakarta servlet packages at runtime, not javax, so tag libraries built for javax packages will not load. The simplest solution is to go back to Tomcat 9.