You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by an...@tumbleweed.com on 2000/11/24 23:11:40 UTC

How to access the session from a custom tag

Hi,
I need to access the session (to get and set attributes) from a custom tag. Any idea? 

Thanks

--ani

Re: How to access the session from a custom tag

Posted by Matthias Kerkhoff <ma...@BESToffers.de>.
> Hi,
> I need to access the session (to get and set attributes) from a custom tag. Any idea? 

getPageContext().getSession()

-- 
Matthias                        (mailto:make@BESToffers.de)



Re: How to access the session from a custom tag

Posted by an...@tumbleweed.com.
I think this works also, right?
        HttpSession session = (HttpSession) pageContext.getSession();
        String .... = (String) session.getAttribute("...");

--ani
----- Original Message -----
From: "Matthias Kerkhoff" <ma...@BESToffers.de>
To: "anna.hristova@tumbleweed.com" <st...@jakarta.apache.org>
Sent: Friday, November 24, 2000 2:27 PM
Subject: Re: How to access the session from a custom tag


> > I need to access the session (to get and set attributes) from a custom
tag. Any idea?
>
> ... or of course ...
>
> getPageContext().getAttribute("AttributeName", SESSION_SCOPE) and
> getPageContext().setAttribute("AttributeName", attribute, SESSION_SCOPE)
>
> --
> Matthias                        (mailto:make@BESToffers.de)
>
>




Re: How to access the session from a custom tag

Posted by Matthias Kerkhoff <ma...@BESToffers.de>.
> I need to access the session (to get and set attributes) from a custom tag. Any idea?

... or of course ...

getPageContext().getAttribute("AttributeName", SESSION_SCOPE) and
getPageContext().setAttribute("AttributeName", attribute, SESSION_SCOPE)

-- 
Matthias                        (mailto:make@BESToffers.de)