You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Eric Martin <er...@ericmmartin.com> on 2008/05/29 17:57:36 UTC

S2 - convert jstl to struts syntax (accessing url parameters)

I have the following code:
<c:if test="${param.error == 'login'}">
   <div
class="error">${sessionScope.SPRING_SECURITY_LAST_EXCEPTION.message}</div>
</c:if>

It seems that param is a jstl specific property, so I'm wondering how to
access a url parameter using struts 2 and the <s:if test=""> syntax.

Thanks!
-- 
View this message in context: http://www.nabble.com/S2---convert-jstl-to-struts-syntax-%28accessing-url-parameters%29-tp17538268p17538268.html
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: S2 - convert jstl to struts syntax (accessing url parameters)

Posted by Lukasz Lenart <lu...@googlemail.com>.
Hi,

Try like this

<s:if test="#attr.error == 'login'}">
  <div class="error">#session.SPRING_SECURITY_LAST_EXCEPTION.message</div>
</s:if>


Regards
-- 
Lukasz
http://www.lenart.org.pl/

Re: S2 - convert jstl to struts syntax (accessing url parameters)

Posted by Dave Newton <ne...@yahoo.com>.
--- Eric Martin <er...@ericmmartin.com> wrote:
> newton.dave wrote:
> > That said, why change it?
> 
> Well, 1) because I have a sick need to change things that work ;) and
> 2) because (rightly or wrongly) I was trying to not have a mishmash
of
> jstl and ognl code.

If it ain't broke, fix it 'til it is, I say.

Dave


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


Re: S2 - convert jstl to struts syntax (accessing url parameters)

Posted by Eric Martin <er...@ericmmartin.com>.

http://struts.apache.org/2.x/docs/ognl.html
</qoute>

Ahh, I didn't think to look at the ognl stack - duh. Thanks for the link.


newton.dave wrote:
> 
> That said, why change it?
> 

Well, 1) because I have a sick need to change things that work ;) and 2)
because (rightly or wrongly) I was trying to not have a mishmash of jstl and
ognl code.

-- 
View this message in context: http://www.nabble.com/S2---convert-jstl-to-struts-syntax-%28accessing-url-parameters%29-tp17538268p17540107.html
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: S2 - convert jstl to struts syntax (accessing url parameters)

Posted by Dave Newton <ne...@yahoo.com>.
--- Eric Martin <er...@ericmmartin.com> wrote:
> I have the following code:
> <c:if test="${param.error == 'login'}">
>    <div
>
class="error">${sessionScope.SPRING_SECURITY_LAST_EXCEPTION.message}</div>
> </c:if>
> 
> It seems that param is a jstl specific property, so I'm wondering how
> to access a url parameter using struts 2 and the <s:if test=""> 
> syntax.

http://struts.apache.org/2.x/docs/ognl.html

That said, why change it?

Dave


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