We’re building a JSP web application, which runs inside the Apache Felix OSGi container (the web app itself is a OSGi Bundle). Now, we’re facing the following problem:
According to the JSP 2.0 Spec, TLD (taglib descriptors) no longer need to reside inside the web apps WEB-INF folder, but are loaded directly from the taglib’s jar META-INF folder. This taglib jars usually reside inside the web apps WEB-INF/lib folder, but because they’re OSGi bundles, they’re loaded by Felix.
In the taglib’s OSGi info, we do import all the needed packages. Anyone out there how knows how to tell the servlet, to search for TLDs also inside the loaded OSGi Bundles?
Thanks for your help!
Pax won’t find your TLDs, if they are in a bundle different from your webapp:
I’m having this problem in a Struts-based system where I share an OSGi-fied Struts bundle between multiple webapp bundles. The webapps have JSPs that need the Struts taglib.
A slightly hackish (because it copies the TLD all over the place) workaround is putting the TLD in your webapp’s
META-INFdirectory and make the webapp bundle import required Struts packages (or, if you don’t use Struts, whatever classes process the tags). This can be automated with Maven like so: