packing images and style sheets with a taglib

2005-04-19 Thread Eric Wood
Hi,

I have a taglib that I am packaging up as a jar and I'm trying to figure out 
how I can package it with images and style sheets that could be referenced in a 
relative path like  in the taglib code. 

 

This way the user of the taglib would not have to worry about creating a 
separate folder and manually adding the required taglib resources in a folder 
off the webroot. Any ideas? 



Re: packing images and style sheets with a taglib

2005-04-19 Thread Rahul P Akolkar
> I have a taglib that I am packaging up as a jar 
> and I'm trying to figure out how I can package it
> with images and style sheets that could be 
> referenced in a relative path like  src="/mytaglibimages/car.gif"> in the taglib code. 

Not sure if you can get relative paths to work with no overhead to the 
taglib user. 

One possibility is to serve the resources using a servlet that maps to the 
url pattern /mytaglibimages/* (or some such). This allows you to pack the 
resources and the servlet in your distro, but the user needs to add the 
servlet definition/mapping to the deployment descriptor (which, arguably, 
might be less error-prone, less of an overhead and easier to document).

-Rahul

P.S.- If you choose to put the servlet in, package java.util.jar provides 
the necessary classes.


Re: packing images and style sheets with a taglib

2005-04-19 Thread Martin Cooper
On 4/19/05, Rahul P Akolkar <[EMAIL PROTECTED]> wrote:
> > I have a taglib that I am packaging up as a jar
> > and I'm trying to figure out how I can package it
> > with images and style sheets that could be
> > referenced in a relative path like  > src="/mytaglibimages/car.gif"> in the taglib code.
> 
> Not sure if you can get relative paths to work with no overhead to the
> taglib user.
> 
> One possibility is to serve the resources using a servlet that maps to the
> url pattern /mytaglibimages/* (or some such). This allows you to pack the
> resources and the servlet in your distro, but the user needs to add the
> servlet definition/mapping to the deployment descriptor (which, arguably,
> might be less error-prone, less of an overhead and easier to document).

It also means you have to deal with cache headers, so that you're not
serving up the same images to the same browser again and again.

--
Martin Cooper


> -Rahul
> 
> P.S.- If you choose to put the servlet in, package java.util.jar provides
> the necessary classes.
> 
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: packing images and style sheets with a taglib

2005-04-19 Thread Rahul P Akolkar
>  It also means you have to deal with cache 
> headers, so that you're not serving up the
> same images to the same browser again and again.

Very true, cache, response-type, in short, you have to behave like a good 
web server ;-) However, its definitely manageable, and by pulling some of 
the overhead upon the taglib author, it aims for taglib user convenience. 
OTOH, the vanilla solution seems to be an auxillary resource bundle (not 
in the i18n sense) users need to download and plop into each app/war. So.

-Rahul


Re: packing images and style sheets with a taglib

2005-04-19 Thread Eric Wood
Thanks for the input and ideas. The servlet approach seems to have potential
but I think because our company will be the only users of the taglib I'm
going to force the user of the lib to paste a special taglib folder into the
context.



It would be really cool if there was a standard that made it possible for a
taglib author to specify a folder in the jar that they want to make
available off the context but I could see how it would create some security
concerns.


- Original Message - 
From: "Rahul P Akolkar" <[EMAIL PROTECTED]>
To: "Tag Libraries Users List" 
Sent: Tuesday, April 19, 2005 4:44 PM
Subject: Re: packing images and style sheets with a taglib


> >  It also means you have to deal with cache
> > headers, so that you're not serving up the
> > same images to the same browser again and again.
>
> Very true, cache, response-type, in short, you have to behave like a good
> web server ;-) However, its definitely manageable, and by pulling some of
> the overhead upon the taglib author, it aims for taglib user convenience.
> OTOH, the vanilla solution seems to be an auxillary resource bundle (not
> in the i18n sense) users need to download and plop into each app/war. So.
>
> -Rahul
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: packing images and style sheets with a taglib

2005-04-19 Thread Rahul Akolkar
On 4/19/05, Eric Wood <[EMAIL PROTECTED]> wrote:
> Thanks for the input and ideas. The servlet approach seems to have potential
> but I think because our company will be the only users of the taglib I'm
> going to force the user of the lib to paste a special taglib folder into the
> context.
> 

That helps ;-)


> It would be really cool if there was a standard that made it possible for a
> taglib author to specify a folder in the jar that they want to make
> available off the context but I could see how it would create some security
> concerns.
> 

You might want to ping your servlet container mailing list (e.g. our
sibling list tomcat-user for tomcat). I suspect this fits those lists
slightly better, and you might even come across an elegant solution
;-)

-Rahul

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]