You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dale Newfield <Da...@Newfield.org> on 2007/10/29 19:54:12 UTC
Re: [struts] S2: EL in tags 2.0.11
cilquirm wrote:
> you could do this
>
> <c:set var="req" value="${pageContext.request}"/>
>
> <s:property value="\%{ attr['req'].contextPath }"/>
>
> <s:property value="\%{ attr['req'].pathInfo }"/>
Isn't the request on the valuestack?
<s:property value="%{#request.contextPath}"/> should be all you need...
http://wiki.opensymphony.com/display/OGNL/OGNL+Basics
-Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: [struts] S2: EL in tags 2.0.11
Posted by cilquirm <aa...@gmail.com>.
My apologies if it was misinterpreted. I did not say it WOULD work, I said
it would take some effort to get it to work, but that it does not work.
At this point, I believe you have a number of options :
1) You can use the method i showed you :
<c:set var="req" value="${pageContext.request}"/>
<s:property value="\%{ attr['req'].contextPath }"/>
<s:property value="\%{ attr['req'].pathInfo }"/>
2) You can build your own custom copy of struts2 that has the tld with the
rtexpr value enabled, but be advised that you are reenabling a security
risk.
3) you can not use s2 tags, if you're that reliant on the jstl/el expression
language.
-a
Manuel Correa wrote:
>
> page <s:property value="%{#request.request.contextPath}"/>
>
> Didn't work!
>
> Have to be a way to active the EL in the Attributes..
>
>
> Manuel Correa.
>
> -----Original Message-----
> From: cilquirm [mailto:aadi.deshpande@gmail.com]
> Sent: Monday, October 29, 2007 3:17 PM
> To: user@struts.apache.org
> Subject: Re: [struts] S2: EL in tags 2.0.11
>
>
>
> I could be wrong ( and I hope I am ), but I thought the request object
> in
> that case was just a map facade to the underlying request attributes
> map.
>
> Which is why I supposed you say #request['foo'] vs.
> #request.getAttribute('foo').
>
> Same goes for session. ( #session['foo'] vs
> #session.getAttribute('foo') )
>
> I just checked Dispatcher and it seems that #request and #session are
> instances of RequestMap and SessionMap respectively, in which a Map
> wraps
> the access to getAttribute.
>
> If these were extended to have a getRequest/getSession method, then we
> might
> be able to say
>
> #request.request.contextPath.
>
>
>
>
>
> DNewfield wrote:
>>
>> cilquirm wrote:
>>> you could do this
>>>
>>> <c:set var="req" value="${pageContext.request}"/>
>>>
>>> <s:property value="\%{ attr['req'].contextPath }"/>
>>>
>>> <s:property value="\%{ attr['req'].pathInfo }"/>
>>
>> Isn't the request on the valuestack?
>> <s:property value="%{#request.contextPath}"/> should be all you
> need...
>>
>> http://wiki.opensymphony.com/display/OGNL/OGNL+Basics
>>
>> -Dale
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/S2%3A-EL-in-tags-2.0.11-tf4712519.html#a13474669
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/S2%3A-EL-in-tags-2.0.11-tf4712519.html#a13476195
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: [struts] S2: EL in tags 2.0.11
Posted by Manuel Correa <mc...@itos.uga.edu>.
page <s:property value="%{#request.request.contextPath}"/>
Didn't work!
Have to be a way to active the EL in the Attributes..
Manuel Correa.
-----Original Message-----
From: cilquirm [mailto:aadi.deshpande@gmail.com]
Sent: Monday, October 29, 2007 3:17 PM
To: user@struts.apache.org
Subject: Re: [struts] S2: EL in tags 2.0.11
I could be wrong ( and I hope I am ), but I thought the request object
in
that case was just a map facade to the underlying request attributes
map.
Which is why I supposed you say #request['foo'] vs.
#request.getAttribute('foo').
Same goes for session. ( #session['foo'] vs
#session.getAttribute('foo') )
I just checked Dispatcher and it seems that #request and #session are
instances of RequestMap and SessionMap respectively, in which a Map
wraps
the access to getAttribute.
If these were extended to have a getRequest/getSession method, then we
might
be able to say
#request.request.contextPath.
DNewfield wrote:
>
> cilquirm wrote:
>> you could do this
>>
>> <c:set var="req" value="${pageContext.request}"/>
>>
>> <s:property value="\%{ attr['req'].contextPath }"/>
>>
>> <s:property value="\%{ attr['req'].pathInfo }"/>
>
> Isn't the request on the valuestack?
> <s:property value="%{#request.contextPath}"/> should be all you
need...
>
> http://wiki.opensymphony.com/display/OGNL/OGNL+Basics
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
--
View this message in context:
http://www.nabble.com/S2%3A-EL-in-tags-2.0.11-tf4712519.html#a13474669
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [struts] S2: EL in tags 2.0.11
Posted by cilquirm <aa...@gmail.com>.
I could be wrong ( and I hope I am ), but I thought the request object in
that case was just a map facade to the underlying request attributes map.
Which is why I supposed you say #request['foo'] vs.
#request.getAttribute('foo').
Same goes for session. ( #session['foo'] vs #session.getAttribute('foo') )
I just checked Dispatcher and it seems that #request and #session are
instances of RequestMap and SessionMap respectively, in which a Map wraps
the access to getAttribute.
If these were extended to have a getRequest/getSession method, then we might
be able to say
#request.request.contextPath.
DNewfield wrote:
>
> cilquirm wrote:
>> you could do this
>>
>> <c:set var="req" value="${pageContext.request}"/>
>>
>> <s:property value="\%{ attr['req'].contextPath }"/>
>>
>> <s:property value="\%{ attr['req'].pathInfo }"/>
>
> Isn't the request on the valuestack?
> <s:property value="%{#request.contextPath}"/> should be all you need...
>
> http://wiki.opensymphony.com/display/OGNL/OGNL+Basics
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/S2%3A-EL-in-tags-2.0.11-tf4712519.html#a13474669
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org