struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manuel Correa" <mcor...@itos.uga.edu>
Subject RE: S2: EL in tags 2.0.11
Date Tue, 30 Oct 2007 16:47:52 GMT
That is not possible, because in Struts 2.0.11 you can't use EL in any
Struts tag, including <s:set ... 



Manuel Correa.


-----Original Message-----
From: Chris Pratt [mailto:thechrispratt@gmail.com] 
Sent: Tuesday, October 30, 2007 12:11 PM
To: Struts Users Mailing List
Subject: Re: S2: EL in tags 2.0.11

On 10/30/07, Manuel Correa <mcorrea@itos.uga.edu> wrote:
> Didn't work: <s:property
value="%{#request['javax.servlet.forward.context_path']"/>
>
> I think that the best solution is rewrite the tld. Is painful.
>
> Manuel Correa.
>

If you're looking for the simplest solution, you should be able to
define a request scoped variable at the top of the page using JSTL:

<c:set var="contextPath" value="${pageContext.request.contextPath"}"
scope="request"/>

And then whenever you need the value using OGNL, you can use:

%{#request['contextPath']}

(possibly surrounding it with <s:property> if necessary)

I agree, it's definitely much harder to understand at a glance, but
until the tag library is truly fixed, this is probably the "easiest"
solution.
  (*Chris*)

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


Mime
View raw message