struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raveendra <ravindra1...@gmail.com>
Subject Re: struts 2.0.11.2 <s:if test=""> problem
Date Wed, 20 Aug 2008 12:38:27 GMT
Thanks Dave and Stephan,

Both your solutions worked when i have user object in my session
<s:if test="#session.user.roleId==0">
This line is working
Initially when i don't have in my session
<s:if test="%{user.roleId==0}">
it is working if i write getters and setters for user object in my action
class

Thanks guys.

>

On Wed, Aug 20, 2008 at 5:37 PM, "Stephan Schröder" <simon.void@gmx.de>wrote:

> your user is in the session not on the value stack therefore you should try
> this:
> <s:if test="#session.user.roleId==0">
>
> /Stephan
>
> -------- Original-Nachricht --------
> > Datum: Wed, 20 Aug 2008 15:11:51 +0530
> > Von: "ravindra" <ravindra@btpsoft.com>
> > An: user@struts.apache.org
> > Betreff: struts 2.0.11.2 <s:if test=""> problem
>
> > Hi all,
> >
> >
> >
> >             I have a user java bean object in my session; it has getter
> > and
> > setter for roleId.I have the following code in my jsp.Here I am trying to
> > load different images
> >
> > Based on the condition.
> >
> >
> >
> > <s:if test="%{user.roleId}==0">
> >
> >             <a href="rescue.action"><img
> src="images/tabs/Rescueadmin.jpg"
> > style="border:none;" width="150" height="83"></a>
> >
> > </s:if>
> >
> > <s:else>
> >
> >      <a href="rescue.action"><img src="images/tabs/five.jpg"
> > style="border:none;" width="150" height="83"></a>
> >
> > </s:else>
> >
> >
> >
> > I think the syntax for test condition has changed in this version of
> > struts.Please any one can help me with this issue.
> >
> >
> >
> > Thankyou,
> >
> > Ravindra.
> >
> >
> >
>
> --
> Psssst! Schon das coole Video vom GMX MultiMessenger gesehen?
> Der Eine für Alle: http://www.gmx.net/de/go/messenger03
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message