tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Help Linking Static Content In a WebApp before and after (6.0.30.x)
Date Wed, 06 Jun 2012 13:29:47 GMT
Hash: SHA1


On 6/6/12 8:45 AM, Morgan, Russel wrote:
> So if I bundle the default servlet with my application and then 
> configure it to run as a different named servlet, and map static 
> resources to it within the webapp that should work? (I will
> certainly try that)
> Also, all "tricks" aside, what is the proper way to address static 
> assets deployed within a webapplication, if pathing them to the
> default servlet is inappropriate?

What's wrong with letting the DefaultServlet continue to do its normal
job by serving every resource that isn't otherwise mapped?

> Forgive my ignorance but couldn't I just set this in my webapp xml 
> descriptor, and "rename" it, and then path to it?

Why bother? If /resources/css/gopublish.css isn't mapped explicitly,
then the DefaultServlet will look in your webapp's /resources/css/
directory for gopublish.css and serve the bytes no problem.

> Perhaps the fact that the code is loaded by the webapp class
> loader makes a difference , I am not sure. (just ruling out this
> possibility)

It does not matter.

I think I've gotten lost... what are you actually trying to
accomplish, here? Do you have a bunch of static content that is
outside of the webapp's docBase that you want to serve from within its
URL space? Any possibility that you could upgrade to Tomcat 7 which
has "aliases" which can do this?

- -chris
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools -
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message