tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
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
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Russel,

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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/PW0sACgkQ9CaO5/Lv0PBAkgCcD8hn/ZtuZal8QQNyFOCNepJc
5+gAnjzbuNER8okInm+w2qXvXkvfSvr3
=v2ck
-----END PGP SIGNATURE-----

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


Mime
View raw message