tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 55734] Manager using absolute URLs
Date Fri, 01 Nov 2013 22:06:42 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=55734

--- Comment #7 from Christopher Schultz <chris@christopherschultz.net> ---
(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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message