struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashish chawre <ashish.chawr...@gmail.com>
Subject Re: Problem using scriplet object in s:if tag
Date Fri, 10 Dec 2010 16:36:53 GMT
Thanks a lot Kevin. It works but I am  wondering why is the user userDTO
not working. If we have a requirement something like this where we have to
use any variable from scriplet in struts tag then how
we will do that.

-- Ashish

On Fri, Dec 10, 2010 at 7:30 AM, Biesbrock, Kevin <Biesbrock.Kevin@aoins.com
> wrote:

> try this:
>
> <s:if test="%{#session.user != null}">Logout</s:if>
>
> It's stored in session and your attribute name is user per your previous
> scriplet.
>
>
> Beez
> r 5347
>
> -----Original Message-----
> From: ashish chawre [mailto:ashish.chawre80@gmail.com]
> Sent: Friday, December 10, 2010 10:22 AM
> To: Struts Users Mailing List
> Subject: Problem using scriplet object in s:if tag
>
> Hi list,
>
> I am trying to use an object from scriplet to <s:if> tag for a
> conditional display purpose.
> Here is the code:
>
> In jsp I am fetching user record from the session <%
>      UserDTO userDTO = (UserDTO)session.getAttribute("user");
> %>
>
> Now I like to show Logout label only if userDTO is avail <s:if
> test="%{#userDto != null}">Logout</s:if>
>
> It doesn't seem to be working out properly. Can anybody please point the
> mistake I am doing.
>
> Thanks in advance!
>
> -- Ashish
>
>
> ---------------------------------------------------------------------
> 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