5 Replies Latest reply on Jun 30, 2009 9:45 PM by Brijesh_Singh

    Accessing Flex session from a Java application

    andreeam
      Hi!
      I am new in Flex. I want to access the Flex session from Java. Mainly I want to know when an user performs login and logout.
      Can anybody help me with an example or some suggestions.
        • 1. Re: Accessing Flex session from a Java application
          stephflex
          Hi andream,

          You may find what you need in :
          Flex 2 Developer's Guide > Data Access and Interconnectivity > Configuring Data Services > Working with session data

          Regards
          • 2. Re: Accessing Flex session from a Java application
            singhsammi

            Hi,

             

            I hope, you know how to invoke java from flex.

             

            In java side java class

             

            Note: flex-messaging-core.jar and it's dependencies should be in class path

             

             

            import flex.messaging.FlexContext;

            import flex.messaging.FlexSession;

             

            public class SessionManager {

             

            private FlexSession session;

             

            public SessionManager()

            {

                  session= FlexContext.getFlexSession();

             

                  if(session.getAttribute("SESS_USER") == null)

                  {

             

                       session.setAttribute("SESS_USER", User from database);

                  }

            }

             

             

            public User getSessionUser()

            {

               

                  return (User)session.getAttribute("SESS_USER");

            }

             

             

            Flex Side SessionManager.mxml
            private function resultHandler(event:ResultEvent):void
            {
            var sessUser:User = null;
            if(event.result is User)
            {
            sessUser = event.result as User;
            }
              Alert.show(sessUser.anyProperty);
            }
            private function faultHandler(event:FaultEvent):void
            {
                Alert.show(event.fault.faultString);
            }
            <mx:RemoteObject id="remoteObject" destination="SessionManager"
                   result="resultHandler(event)"
                   fault="faultHandler(event)"/>
            <mx:Button label="Login" click="remoteObject.getSessionUser"/>
            • 3. Re: Accessing Flex session from a Java application
              Brijesh_Singh

              help integrating Macromedia flex and weblogic 8.1

               

              Can Somebody help me in integrating weblogic 8.1 and macromedia flex. Here I would like to deploy my application using weblogic 8.1, I have tried different things like BlazeDS but nothing seems to work because weblogic 8.1 used jdk1.4 , I´m new at this, can anybody help on how to do this since the beginning??

               

              Thank´s a lot

              [Brijesh]

              • 4. Re: Accessing Flex session from a Java application
                singhsammi Level 1

                Brijesh,

                 

                It will have to migrate to 9.2 or higher..coz each flavor of weblogic comes inbuilt JDK. So weblogic 8.1 has JDK 1.4 and 9.2 has 1.5. There will be lot of compatibility issues with Blazeds using 8.1.

                 

                Harbhai

                • 5. Re: Accessing Flex session from a Java application
                  Brijesh_Singh Level 1

                  Thanks for responce,

                   

                  But I con't change my application server its running on my production  .. so can you suggest how can i used flex+ java integeration with Weblogic 8.1

                   

                  Reg,

                  Brijesh Singh