Randy Murrish wrote:
> I am deploying a web application (let's call it wa1) that includes a tag
> library. I've placed the .tld for the taglib under the wa1/WEB-INF/tlds
> directory and any page inside of wa1 can access the tag library without
> a problem.
>
> Since wa1 is a utility web application, other applications need to have
> access to the taglib stored in wa1. When I try to access the taglib
> from a second web application (call it wa2), I cannot gain access to the
> .tld.
>
> I'm using Tomcat 3.2 b2 and have two Context's defined, one for wa1 and
> a second for wa2. If I copy the .tld into the wa2 context domain, I
> have access to the taglib (all the Tag classes are contained in my
> classpath, not under the lib or classes directory in wa1/WEB-INF).
>
> My question is, how can I access the .tld file contained in wa1 from wa2
> without copying the .tld from wa1 to wa2?
>
You can't.
The whole idea of a web application is to be self-contained, including all of the
configuration files, JSP pages, Java classes, and static resources (like HTML pages
and images) that it needs to be installed and run on *any* servlet container
supporting the 2.2 API. You're trying to go "outside the boundaries" of one
application to access something in another application, and there is no portable
way for that to happen. (You will need to copy the classes or JAR files, also --
or put them on your classpath).
In order to avoid problems of synchronizing updates to the support classes in the
two applications, it is common practice to have your build environment (makefile,
Ant script, or whatever) copy the current version of the TLD and the corresponding
JAR files into the web application structure of every application that needs it,
every time you build the app.
>
> Thanks ... Randy
>
Craig McClanahan
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets