This way of obtaining a Session I think is not a good idiom.

May be there are things that happens behind the scene when obtaining a
session, that's probably why you are not getting a NPE the first time
you call getSession(false) in your code...because "something" already
created it.

S2 have a Map abstraction of session:
http://struts.apache.org/2.1.8.1/docs/how-do-we-get-access-to-the-session.html

HTH

2010/1/14 Cimballi <cimballi.cimba...@gmail.com>:
> Hi,
>
> I have a problem with a JSP and the session the first time I call the
> action which redirects to the page.
> The action sets a variable in the session using the code :
> final HttpSession session =
>   ServletActionContext.getRequest().getSession(false);
> session.setAttribute(name, value);
>
> Then, the action redirects to a page where there is a select tag like :
> <s:select name="xxx" list="#session.sessionValue" />
>
> If I start the application, the first time I call the page I have the
> following error :
> org.apache.jasper.JasperException: tag 'select', field 'list', name
> 'xxx': The requested list key '#session.sessionValue' could not be
> resolved as a collection/array/map/enumeration/iterator type. Example:
> people or people.{name} - [unknown location]
>
> On the second call, it works. Note : I am using a specific
> interceptors stack, so the problem could come from there, even if I
> doubt.
>
> Do you have any idea about where the problem can come from ?
>
> Thanks,
>
> Cimballi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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

Reply via email to