struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pierre Thibaudeau" <pierre.thibaud...@gmail.com>
Subject Re: [S2] current URL in ValueStack?
Date Sun, 20 Jul 2008 19:37:43 GMT
Earlier in this conversation, Jeromy proposed two ways of accessing
the current URL (or URI), one through EL and the other through OGNL

> ${pageContext.request.requestURI}
> <s:property value="%{#context['com.opensymphony.xwork2.dispatcher.HttpServletRequest'].requestURI}"/>

That works great until (it seems) Tiles2 gets in the picture.  By that
point, the address returned is that of the Tiles layout (with
extension ".jsp") and not the logical address of the request.  (I
haven't made a systematic study of the exact conditions for this
phenomenon to occur.)

It seems to me that, having access to the current (logical) URL (the
one that generated this request) is a fairly common need.  Has anyone
come up with another way of getting hold of it?

There is a failsafe option:  make an interceptor that places the URL
in question in the Request scope, but that seems a little heavy-handed
to me...

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message