tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: httpd/Tomcat load balancing question
Date Wed, 22 Dec 2010 22:44:36 GMT

You could also write the links as
<img src="static/mylogo.jpg"/>
(without leading "/").  That would keep them relative to the current app, and cause less 
work if you ever want to call the application other than "Portal".

You could also put the static elements in your app under Tomcat.
Unless there are lots of them, I don't think the difference in performance would be 
significant.  And Tomcat knows how to deal with the session-id suffix.
(And also, past the first access, browsers will cache these things and not request them 
again every time).

Yet another option would be to use mod_rewrite in your front-end server, to strip the 
session-id off the links to static content, before letting them be served by the httpd 
machinery. But that sounds like doing the work twice, which it is.  Better to avoid the 
session-id suffix in the first place.

André Warnier wrote:
> Hi.
> Not knowing anything about JSP per se, I would nevertheless guess that 
> the links are written using something like
> <img src="<%getContextPath%>/static/mylogo.jpg"/> or similarly, instead 
> of just plain html <img src="/Portal/static/mylogo.jpg"/>.
> That probably leads the JSP compiler to think it has to "relativise" the 
> links to the app context and so on, while in this case it should not, 
> because they will be served by the front-end, not by Tomcat.

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

View raw message