tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 55734] Manager using absolute URLs
Date Fri, 01 Nov 2013 22:06:42 GMT

--- Comment #7 from Christopher Schultz <> ---
(In reply to Milo Hyson from comment #4)
> As a general rule, developers should NOT be using request.getContextPath() as you suggest.

I disagree. Relative links fail in all sorts of bad ways, which is why all JSP
tag libraries, tools, etc. automatically insert the context-path at the
beginning of all their URLs /by default/. It's not even clear to me that you
can disable this kind of thing in JSTL for example.

> That just binds application content to a deployment-time concern.

Again, I disagree: in fact it frees the application from deployment-time
concerns. If you re-name the context, the web application continues to work
properly. If the page you are accessing was due to a "forward", the links
continue to work even if the browser's URL resolution would otherwise create
bad links.

> Given [this] approach, producing relative URLs is not likely to be trivial.

It would be trivial yet irrelevant.

If you want to use a different context-path, don't play proxying games: just
rename the context so it has the deployment path you want it to have.

You are receiving this mail because:
You are the assignee for the bug.

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

View raw message