Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

Proxy Setup to Remap /servlets in Apache to / in Tomcat

Aaron Longwell

2003-09-18

Replies:

I have a hosting provider who is hosting my site in the following configuration:

Apache receives all requests.
Anything with a /servlets/ in the URL gets ProxyPath'ed to Tomcat.
Tomcat gets a URL like http://www.server.com/servlets/context/servletMapping.do
The problem is that I want Tomcat to ignore the /servlets in the URL.... so there is an effective
mapping like so:

/servlets in Apache == / in Tomcat

I'm having a problem using the JSTL tags, c:url, c:redirect, etc. They try to redirect to
/contextName/URL, which causes Apache to give a 404.

JSTL creates a URL like <img src="/context/fileName">
I want it to create <img src="/servlets/context/fileName">

Essentially, I need it to preface the Servlet Spec contextPath() with a "proxy Path"

Is this possible?

Having my hosting provider set up a little differently is an option, but the proxy is preferred
for other reasons.

Thanks for the assistance,
Aaron Longwell

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.