You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Don Hill <dh...@pair.com> on 2005/04/09 18:49:51 UTC

images/static content in jar

I have a war that has folder like /images and /content, is there a way 
to config tomcat so that I can package these in  jar, I know I can write 
a custom servlet todo this but I would like this to be handled by the 
servers servlet container. The reason this is my concern is that I think 
that the servlet container has a better model for handling request 
rather than a servlet that has to invoke a openStream, seems this would 
cause some contention and perf issues.

Thanks

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


Re: images/static content in jar

Posted by Don Hill <dh...@pair.com>.
Nikola Milutinovic wrote:

> Don Hill wrote:
>
>> I have a war that has folder like /images and /content, is there a 
>> way to config tomcat so that I can package these in  jar, I know I 
>> can write a custom servlet todo this but I would like this to be 
>> handled by the servers servlet container. The reason this is my 
>> concern is that I think that the servlet container has a better model 
>> for handling request rather than a servlet that has to invoke a 
>> openStream, seems this would cause some contention and perf issues.
>
>
>
> Just to clarify (not really offering a solution, sorry). The reason 
> why you want to do that is to have some ability like "skins" in 
> Mozilla and other products, right?
>
> I mean, all static content can be a packaged into a WAR file, if 
> packaging is what you need. If you'd like to have skins for your 
> application, even dynamic skins, I'd sugest a servlet that would 
> unpack/remove all static content from a set of JARs. A skin change would:
>
> - unpack a new JAR to a temp dir
> - stop or pause the application
> - mv "static" dir to some other name
> - mv temp dir to "static"
> - un-pause application
> - cleanup
>
> Access to static content would still be better off being handled 
> through a servlet, how would you expire the old data otehrwise? 
> Imagine half of your skin being new and the other half old...
>
> Nix.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
Yeah but this is a little more than that, the app has many, many , many 
resources curently we are using a servlet that calls Singleton in the 
get and the class then gets the bytes, there is a bit of contention at 
times, this app may at times have like 1000 users and when rendering 
pages may need images, style sheets, xml.....

I was just wondering before I re-design the servlet and resource class.

Thanks

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


Re: images/static content in jar

Posted by Nikola Milutinovic <Ni...@ev.co.yu>.
Don Hill wrote:

> I have a war that has folder like /images and /content, is there a way 
> to config tomcat so that I can package these in  jar, I know I can 
> write a custom servlet todo this but I would like this to be handled 
> by the servers servlet container. The reason this is my concern is 
> that I think that the servlet container has a better model for 
> handling request rather than a servlet that has to invoke a 
> openStream, seems this would cause some contention and perf issues.


Just to clarify (not really offering a solution, sorry). The reason why 
you want to do that is to have some ability like "skins" in Mozilla and 
other products, right?

I mean, all static content can be a packaged into a WAR file, if 
packaging is what you need. If you'd like to have skins for your 
application, even dynamic skins, I'd sugest a servlet that would 
unpack/remove all static content from a set of JARs. A skin change would:

- unpack a new JAR to a temp dir
- stop or pause the application
- mv "static" dir to some other name
- mv temp dir to "static"
- un-pause application
- cleanup

Access to static content would still be better off being handled through 
a servlet, how would you expire the old data otehrwise? Imagine half of 
your skin being new and the other half old...

Nix.

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