Thanks Ray.

I've got it working now.

There were a lot of changes I had to make - demonstrating again that it's a
lot easier to get stuff working on JRun than on Tomcat.

In case anyone's interested I think the steps were:

1. Make each taglib into its own Java package
2. Create a subdirectory for each one called META-INF
3. Put the TLD for each taglib into the appropriate META-INF directory
4. Rename all TLD's to "taglib.tld"
5. For each taglib, package the classes plus the META-INF directory into a
jar file
6. Put the jar file into WEB-INF/lib
7. In web.xml, map the taglib URI to point to the jar file
8. Also put the class files for the tag handlers into the tree structure
under WEB-INF/classes

That setup works in both environments.

Nick


----- Original Message -----
From: Ray Thomas <[EMAIL PROTECTED]>
To: JRun-Talk <[EMAIL PROTECTED]>
Sent: Saturday, November 24, 2001 5:43 PM
Subject: RE: Taglibs, TLDs and web.xml on Tomcat versus JRun


> The DTD for web.xml can be viewed in a browser at:
> http://java.sun.com/j2ee/dtds/web-app_2.2.dtd
> It describes the structure and content of web.xml.
>
> Particularly, to declare a taglib, you need something like the following
pretty much at the end of web.xml inside the web-app tag:
>
> <taglib>
>  <taglib-uri>mytaglib</taglib-uri>
>  <taglib-location>/META-INF/mytags.tld</taglib-location>
> </taglib>
>
> Then you use it in a jsp with a statement like this:
>
> <%@ taglib uri="mytaglib" prefix="mytag" %>
>
> and tags in the page like this:
>
> <mytag:sometag param1="whatever" param2="whatever">
> </mytag>
>
> The classes just have to be found in the classpath for the web app so they
can be jarred in WEB-INF/lib or regular .class files in WEB-INF/classes.
>
> JRun might not require this structure with web.xml, but it still works if
you deploy it this way.  You might get a head start by looking at the
web.xml that JRun generates (found directly under WEB-INF in the
corresponding web-app).
>
> Hope this helps...
>
> -R
> >date: Thu, 22 Nov 2001 19:48:25 -0000
> > "Nick de Voil" <[EMAIL PROTECTED]> Taglibs, TLDs and web.xml on Tomcat
versus JRunReply-To: [EMAIL PROTECTED]
> > JRun-Talk <[EMAIL PROTECTED]>
> >I have developed a JSP app which works great on my PC under JRun 3.0 and
> >W2K.
> >
> >It makes extensive use of custom tags.
> >
> >To get them working I just followed the instructions in the manual -
> >basically just created a TLD. There didn't seem to be any need to create
a
> >web.xml file. Or to put the classes in a JAR file.
> >
> >Now I am trying to install the app on a server with Tomcat 3.2.3 and
Linux,
> >in a hurry and I am having problems. It seems to want a web.xml file -
OK, I
> >have created that - but what exactly should it say? Do the classes have
to
> >be in a JAR? Does anything else have to be in it? Where should it be
> >located? Where should the TLD be located?
> >
> >Can anyone clarify this for me or point me at a resource?
> >
> >Thanks a lot
> >
> >Nick
> >
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to