users@glassfish.java.net

Re: Sharing tag files between web apps

From: Jose Noheda <jose.noheda_at_gmail.com>
Date: Fri, 20 Jun 2008 14:05:53 +0200

Thank you, I didn't knew you could pack them in JARs (my bad!). Problem
solved then!

Regards,

On Fri, Jun 20, 2008 at 2:14 PM, <glassfish_at_javadesktop.org> wrote:

> It is not clear how alternate docroots can be used for sharing of tag
> files. So here is another possible approach for sharing tag files.
>
> Note that JSP spec defines two different locations for tag files:
> a. in the WEB-INF/tags directory (as you noted).
> b. package in a jar file that can be placed in WEB-INF/lib directory. This
> allows tags to be reused across web applications and portable across
> containers.
>
> JSP spec describes how to package tags in a jar but to illustrate here are
> the steps:
>
> 1. Construct a jar file mycustomtags.jar as follows.
>
> META-INF/
> mytags.tld
> tags/
> foo.tag
> bar.tag
>
> The mytags.tld is required by the JSP spec. mytags.tld describes each of
> the tags
> using a <tag-file> element for each tag file. The <tag-file> contains a
> sub element
> <path>. The value of <path> element must begin with META-INF/tags.
>
> 2. Place mycustomtags.jar in WEB-INF/lib directory of each web application.
>
> 3. Use taglib directive with uri attribute to reference the jar file.
> <%@ taglib prefix="t" uri="mycustomtags" %>
> [Message sent by forum member 'sekhar' (sekhar)]
>
> http://forums.java.net/jive/thread.jspa?messageID=281587
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>