tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hassan Schroeder" <hassan.schroe...@gmail.com>
Subject Re: Serving CSS files from a certain URL
Date Wed, 05 Jul 2006 16:38:39 GMT
On 7/5/06, Alec Swan <aukcioner@yahoo.com> 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:

	<servlet>
		<servlet-name>Test</servlet-name>
		<jsp-file>/WEB-INF/jsp/Test.jsp</jsp-file>
	</servlet>
	<servlet-mapping>
		<servlet-name>Test</servlet-name>
		<url-pattern>/test</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>Test</servlet-name>
		<url-pattern>/foo/bar/test</url-pattern>
	</servlet-mapping>	

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
View raw message