I found a solution. It seems that Jasper, which is in a JBOSS module (jbossweb-7.2.0.Final-redhat-1.jar), is unable to access my tld file located in /WEB-INF/lib/. The same code works in JBOSS 5, Websphere 6 and in any version of Tomcat. I think this is a class loading issue. When I moved my tld file inside a /META-INF folder within a jar file it started working. I did not need the taglib reference in the web.xml anymore, because the tld file is automatically picked up from the jar file /META-INF folder. Here's the final code:
Declare taglib in jsp:
<%@ taglib uri="http://mycompany/abtags" prefix="abtag" %>
packaged tld file insde a jar:
/WEB-INF/lib/XYZ.jar
XYZ.jar content:
/META-INF/abtaglib.tld
/META-INF/MANIFEST.MF
abtaglib.tld content
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.1</jsp-version>
<short-name>abtag</short-name>
<uri>http://mycompany/abtags</uri>
<display-name>XYZ Tag</display-name>
...