You can access the HTTP session from within action beans by doing the
following:
getContext().getRequest().getSession(false)
It will return null if there's no session (yet). You can also pass true as
parameter or use the getSession() method which will create a session if it
isn't available. On that session, you can invoke the getAttribute method to
obtain session attributes.
Levi
On Mon, Dec 8, 2008 at 2:42 PM, kriko <[EMAIL PROTECTED]> wrote:
> Hello!
>
> I tried to get session attributes in similar ways:
> System.out.println(this.getContext().getMessages());
> System.out.println(this.getContext().getResponse().getContentType());
>
> System.out.println(this.getContext().getServletContext().getAttribute("delauthtoken"));
>
> but never got anything (null).
>
> Here is a working jsp example:
> http://pastebin.com/m7588127f
>
> line 18 is the one:
> String t = (String) session.getAttribute(TOKEN);
>
> How can I get session attributes inside actionbean?
> It would be helpfull to get an example.
>
> thanks.
>
> --
> kriko
>
>
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you. Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
>
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users