tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alec Swan <aukcio...@yahoo.com>
Subject Re: Serving CSS files from a certain URL
Date Wed, 05 Jul 2006 16:52:28 GMT
You are right, the problem is with the way JSPs are deployed. I do use the first servlet-mapping
pattern, which does NOT match the full path, but rather the context path /testapp.

I like your idea of using filters to rewrite CSS paths. Could you give me a hint on how to
do that best?

Thanks.

Hassan Schroeder <hassan.schroeder@gmail.com> wrote: On 7/5/06, Alec Swan  wrote:
> In any case I don't understand why this works in your case.

Now that I have more coffee in me, me neither :-)  It really shouldn't, and
I'm at another location now, so I can't revisit that, but...

The problem is that "relative" to the container depends on how your JSP
is being invoked; consider:

 
  Test
  /WEB-INF/jsp/Test.jsp
 
 
  Test
  /test
 
 
  Test
  /foo/bar/test
  

The second mapping will work with your ../../css/Styles.css link, the
first will not.

> BTW, why do you think it's a bad idea to keep web designers focused on the look and feel
of the site and releaving them from the deployment details?

OT to the list -- but I think a development team should work within a
common (consistent) environment. Otherwise you wind up jumping
through the kind of hoops we're discussing now. :-)

In any case, if I *had* to solve this problem, I'd use the relative links
that work for your 'static' situation, and then either

1) serve all *.css files with a servlet that "fixes" the paths or
2) rewrite the css file paths with a Filter

HTH,
-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

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



Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message