I have the following situation:
taglib.jar: A custom JSP taglib packaged as a JAR file. The TLD file is/META-INF/taglib.tld.webapp.war: A web application with JSP files that use the tags provided bytaglib.jar.app.ear: A J2EE application which containswebapp.warand other WAR files.
I want to package a single taglib.jar in app.ear so the JSP files in webapp.war and the other WAR files can all use its tags. I tried the following directives in the JSP files, without success:
<%@ taglib uri="/taglib.jar" prefix="xxx" %><%@ taglib uri="taglib.jar" prefix="xxx" %>
Is it possible to package the JSP taglib JAR file in an EAR file? If yes, which value should I specify in the uri attribute of the taglib directive?
Note: I could of course package taglib.jar in the /WEB-INF/lib of each WAR file, but that is just what I try to avoid.
Context: I deploy the EAR file on JBoss 4.2.3.
Edit: I’m afraid this is impossible, especially since I read the section about skinny WARs from the Maven WAR plugin documentation:
Sometimes a list of JARs must be packaged into the WAR (…) in order for it to work properly, like with tag libraries.
This is not possible. The best I could do is to package
taglib.jarin the EAR file, and duplicate the TLD file in the/WEB-INFdirectory of each WAR file.