cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <Ralph.Go...@dslextreme.com>
Subject RE: finding the URL of the current Cocoon application?
Date Sat, 04 Sep 2004 22:55:03 GMT
At 9/4/2004  09:08 AM, you wrote:

>Anyway, Ralph, I would be happy to hear from you how to get the
>http servlet request from Java. Especially if it's different from
>{request:servletPath} and {request:requestURI}, both
>of which return the outer URI.
>
>Thanks,
>Lars

If real path is what I think it is it would be the value from getRealPath() 
from the session context.  That will return null if you are in a war file.

As for getting the HttpServletRequest, many Cocoon interfaces pass the 
object model as a parameter on methods. To get the HttpServletRequest you do:

HttpServletRequest servletRequest = 
(HttpServletRequest)objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT);

It would be trivial to write a HttpRequest input module. Just take the 
Request input module and replace the line that retrieves the request with 
the one above.

Ralph



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message