tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Moore" <tmo...@blackboard.com>
Subject RE: Shared JSP taglibs
Date Fri, 04 Oct 2002 17:23:21 GMT
> - All the webapps running in this Tomcat installation must
>   share the same version of the tag library (or whatever -- it's
>   not just limited to these), so you have to upgrade them all
>   together in lockstep.

Ah, but that's exactly what I want! :-)

We have a fairly atypical situation here where our system is implemented
as a group of loosely connected webapps that all look like the same
application to the user.  Some of our tags exist to provide a standard
look & feel across these webapps, so obviously we don't want them to
fall out of sync.

Currently, the tag handler classes are in a shared JAR, and the tlds are
shared using SourceSafe links into each webapp's WEB-INF directory.
It's workable but not perfect.

I know that JSP 2.0 requires that the JSTL be made available by the
container, so I'll just let it be known for Tomcat 5 that it would be
nice if there were some kind of shared taglib directy where we could
just drop taglib JARs and have them automatically available to every
webapp.

Thanks!
-- 
Tim Moore / Blackboard Inc. / Software Engineer
1899 L Street, NW / 5th Floor / Washington, DC 20036
Phone 202-463-4860 ext. 258 / Fax 202-463-4863


> -----Original Message-----
> From: Craig R. McClanahan [mailto:craigmcc@apache.org] 
> Sent: Friday, October 04, 2002 1:09 PM
> To: Tomcat Users List; shanmugampl@india.adventnet.com
> Subject: Re: Shared JSP taglibs
> 
> 
> 
> 
> On Fri, 4 Oct 2002, shanmugampl wrote:
> 
> > Date: Fri, 04 Oct 2002 09:46:32 +0530
> > From: shanmugampl <shanmugampl@india.adventnet.com>
> > Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>,
> >      shanmugampl@india.adventnet.com
> > To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> > Subject: Re: Shared JSP taglibs
> >
> > I dont think that this solution will solve the problem. It 
> says that 
> > instead of copying the tld files,  make them as a jar and put it in 
> > the WEB-INF/lib directory. Still i will have to duplicate the tld 
> > files which is not desired.
> 
> I don't have this problem -- but maybe it is because of the 
> way that I have my development environment organized.
> 
> I separate the build process such that each tag library is 
> built separately - and the output is a JAR file which 
> includes the TLD.  Now, whenever I want to use this tag 
> library in a webapp, all I need to do is grab that JAR file 
> and drop it into /WEB-INF/lib.
> 
> > I have this same problem. What i want to know is
> > that, like having the classes in shared jar(<Tomcat 
> > home>/shared/lib/), can i move my tld files outside my 
> webapp and have 
> > it at a single place and access it across my contexts
> >
> 
> In my experience, the (small) memory savings of putting 
> classes into /shared/lib (or /common/lib) is not worth the 
> hassles it brings:
> 
> - All the webapps running in this Tomcat installation must
>   share the same version of the tag library (or whatever -- it's
>   not just limited to these), so you have to upgrade them all
>   together in lockstep.
> 
> - If your shared library wants to access application-specific classes
>   that are only available in /WEB-INF/classes or /WEB-INF/lib, you
>   have to program them specifically to access those classes via the
>   thread context class loader.
> 
> - You are depending on a non-portable feature of Tomcat (no concept
>   of shared library directories is required by any of the Java specs;
>   although most servers offer something like it, they are all
>   implemented differently).
> 
> My advice would be to make your webapps as self-contained and 
> independently replaceable as possible.  Sharing classes 
> across webapps is not the way to do this.
> 
> > shan
> 
> Craig
> 
> >
> > Craig R. McClanahan wrote:
> >
> > >Tomcat 4.1 doesn't have any "known to the container" 
> mechanisms built 
> > >in, but there is a strategy you can use (also portable) to avoid 
> > >having to separately copy TLDs into your webapps.  You can put TLD 
> > >files in the "META-INF/tlds" directory of a JAR file in 
> /WEB-INF/lib 
> > >(presumably the JAR containing your tag library implementation 
> > >classes), and Tomcat will automatically recognize it.  In fact, if 
> > >your pages use the same URI that you specify in the <uri> 
> element in 
> > >the TLD, you don't need to declare them in the web.xml file either.
> > >
> > >Now, using a tag library is simply a matter of dropping a JAR file 
> > >into /WEB-INF/lib.
> > >
> > >Craig
> > >
> > >
> > >
> > >On Thu, 3 Oct 2002, Tim Moore wrote:
> > >
> > >
> > >
> > >>Date: Thu, 3 Oct 2002 18:11:16 -0400
> > >>From: Tim Moore <tmoore@blackboard.com>
> > >>Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> > >>To: tomcat-user@jakarta.apache.org
> > >>Subject: Shared JSP taglibs
> > >>
> > >>>>From the JavaServer Pages 1.2 Specification:
> > >>
> > >>JSP.7.3.5 Implicit Map entries from the Container
> > >>The container may also add additional entries to the 
> taglib map. As 
> > >>in the previous case, the entries are only added for URIs 
> that are 
> > >>not present in the map. Conceptually
> > >>the entries correspond to TLD describing these tag libraries.
> > >>These implicit map entries correspond to libraries that 
> are known to the
> > >>container, who is responsible for providing their 
> implementation, either
> > >>through
> > >>tag handlers, or via the mechanism described in Section JSP.7.3.9.
> > >>
> > >>Does Tomcat 4.1.x support this in any way? If so, can I 
> add my own 
> > >>taglibs to the map of known taglibs?  We have several webapps 
> > >>running on the same server that use the same tag libraries.  
> > >>Currently, we have the tag handler classes in a shared 
> JAR, and copy 
> > >>the TLD files into each webapp.  If I could avoid having 
> to do the 
> > >>latter, that would be nice.
> > >>:-) I haven't seen anything to indicate that it's 
> possible, but if it
> > >>is, that would be cool!
> > >>--
> > >>Tim Moore / Blackboard Inc. / Software Engineer
> > >>1899 L Street, NW / 5th Floor / Washington, DC 20036
> > >>Phone 202-463-4860 ext. 258 / Fax 202-463-4863
> > >>
> > >>
> > >>--
> > >>To unsubscribe, e-mail:   
> <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> > >>For 
> additional commands, e-mail: 
> > >><mailto:tomcat-user-help@jakarta.apache.org>
> > >>
> > >>
> > >>
> > >>
> > >
> > >
> > >--
> > >To unsubscribe, e-mail:   
> <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> > >For 
> additional commands, e-mail: 
> > ><mailto:tomcat-user-help@jakarta.apache.org>
> > >
> > >
> > >
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <mailto:tomcat-user-help@jakarta.apache.org>
> 
> 

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message