tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alessandro Vernet" <aver...@gmail.com>
Subject Context, c:import, and request URI
Date Wed, 12 Jul 2006 21:41:01 GMT
I have two war deployed on Tomcat: war1 and war2. When a request comes
from /war1/path1, a JSP in war1 runs and with the JSTL c:import [1]
imports something from war2:

<c:import context="war2" url="/url2"/>

This works because crossContext [2] is set to true in the Tomcat
configuration. Now the problem is that in war2, a
request.getRequestURI() returns /war1/url1. I expected that method to
return /war2/url2 instead. My questions are:

a) Is this is a bug or a feature?
b) What API can I use to get /war2/url2?

I see request.getAttribute("org.apache.catalina.core.DISPATCHER_REQUEST_PATH")
would do the trick with Tomcat, but that would not be portable to
other servlet containers. Any suggestion is appreciated.

References:
[1] http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/c/import.html
[2] http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

Alex
-- 
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/

---------------------------------------------------------------------
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