Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Accessing Flex session from a Java application

Avatar

Level 1
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.

5 Replies

Avatar

Level 2
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

Avatar

Level 1

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"/>

Avatar

Level 1

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]

Avatar

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

Avatar

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