tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomas Hofman <>
Subject TLD files packaged in JAR required to be under META-INF/resources?
Date Wed, 30 May 2018 10:13:48 GMT

I run into something that looks like non spec-conforming behavior and would 
like to check with you if it's really a bug or I'm having incorrect expectations.

I have TLD located in JAR under META-INF/tlds/hi.tld. The JAR also contains 
web-fragment.xml with taglib mapping like this:

   <web-fragment ...>

This JAR is loaded in a WAR, that contains JSP with following directive:

   <%@ taglib uri="/HiTag" prefix="say"%>

During deployment in apache-tomcat-9.0.8 I see this warning:

30-May-2018 10:38:42.240 WARNING 
org.apache.jasper.servlet.TldScanner.scanJspConfig Failed to process TLD with 
path [/tlds/hi.tld] and URI [/HiTag]. The specified path does not exist.

and the jsp compilation fails.

When I move the TLD under META-INF/resources, then it starts to work.
When I use implicit mapping by defining <uri> element in hi.tld instead of 
explicit mapping in web-fragment.xml, that works too.

The JSP spec says that TLDs must be in META-INF/ or subdirectories:

JSP 7.3.1

When deployed inside a JAR file, the tag library descriptor files must be in 
the META-INF directory, or a subdirectory of it.

I think it's caused by this line in

where ServletContext#getResource() would naturally see only files under 
META-INF/resources/ dir.

Thanks for any opinions!

Tomas Hofman
Software Engineer, JBoss SET
Red Hat

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message