I am trying to get the session attribute in spring webflow, but it doesn't work. In some controllers I have:
User u = userDao.getUser(userName);
session.setAttribute("sessionUser", u);
In JSP, I can get it, and it works fine:
${sessionScope.sessionUser.getLogin()}
I tried something like this:
<decision-state id="isUserLogged">
<if test="sessionUser.getLogin() != null" then="startView" else="start" />
</decision-state>
but I get the error:
EL1008E:(pos 0): Field or property 'sessionUser' cannot be found on object of type 'org.springframework.webflow.engine.impl.RequestControlContextImpl'
or
<decision-state id="isUserLogged">
<if test="${sessionScope.sessionUser.getLogin()}" then="startView" else="start" />
</decision-state>
error:
EL1041E:(pos 1): After parsing a valid expression, there is still more data in the expression: 'lcurly({)'
My first question is, how can I get sessionUser
in webflow?
I also tried calling the controller method, because in controller method I can get sessionUser
, but it doesn't work.
My second question is, how can I call controller method in webflow?