Reputation: 43570
I have a set of .tag files (for example a tag that renders a copyright notice) that I want to share across all my application contexts on my Tomcat application server.
I've only ever used them in a context's /WEB-INF/tags directory, referring to them via the taglib directive tagdir = "/WEB-INF/tags"
How can I make the tags available to all my contexts?
Upvotes: 0
Views: 474
Reputation: 104188
As an alternative to adding the tag files to all contexts, why not try giving an absolute path to the taglib-location in the taglib element in the web.xml:
<taglib>
<taglib-uri>mytaglib</taglib-uri>
<taglib-location>/mytaglib.tld</taglib-location>
</taglib>
You would need to define a common repository for all applications. I haven't tried it myself.
Upvotes: 0
Reputation: 308848
You probably have to put them in a directory where shared JARs go. The proper place depends on the version of Tomcat you're running. On versions 4.x and 5.x, it could be common/lib, because the files in that directory are visible to both the server and all contexts. On versions 6.x, it could be the /lib directory. Check your docs and try it.
Upvotes: 1