Reputation: 1
I have my flex object embedded to JSP page.The JSP page retrieves user information like user name and group from portal profile object and stores in http session parameters. The flex Object makes a remote call to Employee.class to perform persona based operation.
I retrieved the session id in JSP and also in the Employee.class both are same. But I am not able to retrieve the username stored in the http session from FlexSession. I read in the internet that the FelxSession will hold all httpSession information as well. It’s always coming as null. Correct me if I am wrong.
In the JSP I set the
session.setAttribute("sasUserName","sasdemo");
session.setAttribute("sasGroupList",gl);
In Employee.class
import flex.messaging.FlexSession;
import flex.messaging.FlexContext;
mySession = (FlexSession)FlexContext.getFlexSession();
mySession.getAttribute("sasUserName")
Let me know if I need to make any other set up.
Upvotes: 0
Views: 1892
Reputation: 5308
FlexContext should be called only inside of a blazeds AMF request - otherwise all the content is null. What happens is:
a)an AMF call is invoked
b)the MesageBroker servlet will setup the FlexContext object
c)the invoked method is executed
d)the MessageBroker servlet will clear the FlexContext object
e)the result of the call is returned.
Let me know if it's clear enough.
Upvotes: 2