struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samuel Robert <>
Subject [Struts2] session variable empty in the JSP
Date Mon, 27 Feb 2012 13:33:03 GMT

I faced few days ago a problem with the session variable in the JSP. I
posted the problem here but did not get any solution:

Perhaps some of you have an idea.

Basically the session variable in the JSP is empty on the first call to my
action (when the session gets initialized).
That means that my JSP fails to retrieve any information from the session
in the Struts tags on the first display.
>From the second call it is OK.

I have checked that the session is correctly initialized in the JSP. The
problem comes only with the session variable in the struts tags.

<% System.out.println(((my.bean.SessionBean)session.getAttribute("context")).getProfiles());
%> => OK

<s:property value="%{#session}"/> => KO (empty)

${session} => KO

I solved it by adding an additional redirectAction on the first access
(when I detect that it is a new session).
But I wonder why I get such a problem, which I never had before.


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