-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Patrick,
On 9/18/2011 12:55 PM, Patrick Flaherty wrote: > All the skins work except image references in the style sheet (css) > cannot be found. Yet images referenced in the jsps are found! Your JSPs are dynamic and include the webapp prefix, since you (evidently) properly prefixed and encoded your URLs (good for you). Your CSS files are not dynamic and, unless you put the prefixes on there, your images will not be found. Note that any included CSS files will also not be found (i.e. CSS includes CSS) for the same reason. > Is there a hard and fast rule here I’m missing. What’s best > practice ? I dunno about best practice, but we do what you are doing: put the webapp prefix into the CSS files and don't forget to change it if you re-locate the webapp to another prefix (which pretty much never happens). There are other options that I can think of off the top of my head: 1. Use the HTML <base /> tag to set the base URL in your dynamic pages. Any relative URLs will be relative to that base. This may ruin the URLs that you have carefully and properly prefixed and escaped in your JSPs, but it's an option. 2. Make your CSS files dynamic: have Tomcat serve them and perform the context-path translation on the fly. 3. Use server-side content filtering for .css files. This is roughly the same as #2 except that you would use a simpler string-replace mechanism instead of a fully-dynamic content-generation technology (such as JSP, etc.). 4. Write a bunch of URL rewrite rules that match the CSS/image files that you know aren't in the "right" place. This is going to be a pain in the neck. I'm sure there are other options. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk53oi4ACgkQ9CaO5/Lv0PDnGwCeKJOSDGA6m8Zn5t/rXMqCYoxV odQAoL/fL3+MahdfAoS70JDGEvOe6+vg =TcFo -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org