Actually this is full code for Client and server Java classes should reside
on middle tier and flex is front end....I wrote already which one flex code
and which one is java and for communication do some configuration in blazeds
in remoting-config file i already sent it to you

On Fri, Jul 30, 2010 at 8:25 AM, Gerald Anto Fernando <
flex.gerald.a...@gmail.com> wrote:

> hi sidhu, this is gerald . i saw your code.
> can you please explain me detail.
> *Am new to flex.*
>
> first one is main application class ok
>
> second(TestSession) and third (SessionMgt) are seems like java classes.
>
> if so, shall we call java class directly from flex and where to store it
> and how to compile it(where to store class files)
> or
> flex builder can compile or run the java code.
>
> please make let me clear
>
>
>   On Thu, Jul 29, 2010 at 8:01 PM, Sidhu Vijay Sidhu <singh.v...@gmail.com
> > wrote:
>
>>   Client side code
>> <?xml version="1.0" encoding="utf-8"?>
>> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
>> layout="horizontal">
>>
>>    <mx:TextInput id="iptUser" />
>>
>>    <mx:RemoteObject id="setService" destination="setsession"
>>        result="handleSetResult(event)" fault="handleFault(event)">
>>    </mx:RemoteObject>
>>
>>    <mx:RemoteObject id="getService" destination="getsession"
>>        result="handleGetResult(event)" fault="handleFault(event)">
>>    </mx:RemoteObject>
>>
>>    <mx:Button label="Invoke setSession()">
>>        <mx:click>
>>         <![CDATA[
>>          setService.setUser(iptUser.text);
>>         ]]>
>>        </mx:click>
>>    </mx:Button>
>>
>>    <mx:Button label="Invoke getSession()" click="getService.getUser()" />
>>
>>    <mx:Script>
>>     <![CDATA[
>>      import mx.controls.Alert;
>>      import mx.collections.ArrayCollection;
>>      import mx.rpc.events.FaultEvent;
>>      import mx.rpc.events.ResultEvent;
>>
>>      public function handleSetResult(event:ResultEvent):void{
>>         Alert.show(event.result.toString());
>>      }
>>
>>      public function handleGetResult(event:ResultEvent):void{
>>         Alert.show(event.result.toString());
>>      }
>>
>>      public function handleFault(event:FaultEvent):void{
>>       trace('handleFault()');
>>          trace(event.fault);
>>      }
>>     ]]>
>>    </mx:Script>
>> </mx:Application>
>> ----------------------------------------------
>> Put this Remoting-config file in blazeds
>> <?xml version="1.0" encoding="UTF-8"?>
>> <service id="remoting-service"
>>     class="flex.messaging.services.RemotingService">
>>     <adapters>
>>         <adapter-definition id="java-object"
>> class="flex.messaging.services.remoting.adapters.JavaAdapter"
>> default="true"/>
>>     </adapters>
>>     <default-channels>
>>         <channel ref="my-amf"/>
>>     </default-channels>
>>
>>
>>     <destination id="setsession">
>>        <properties>
>>           <source>remoting.SessionMgt</source>
>>        </properties>
>>     </destination>
>>
>>     <destination id="getsession">
>>        <properties>
>>           <source>remoting.TestSession</source>
>>        </properties>
>>     </destination>
>>
>> </service>
>> --------
>> ServerCode
>> --------------
>> package remoting;
>> import flex.messaging.FlexContext;
>> import flex.messaging.FlexSession;
>> public class TestSession {
>>    FlexSession session;
>>
>>    public TestSession(){
>>     session = FlexContext.getFlexSession();
>>    }
>>
>>    public String getUser(){
>>     System.out.println(session.getId());
>>     return (String)session.getAttribute("user");
>>    }
>>
>> }
>> second file
>> -------------
>> package remoting;
>> import flex.messaging.FlexContext;
>> import flex.messaging.FlexSession;
>> public class SessionMgt {
>>     FlexSession session;
>>
>>  public SessionMgt(){
>>   session = FlexContext.getFlexSession();
>>  }
>>
>>  public String setUser(String username){
>>   session.setAttribute("user", username);
>>   System.out.println(session.getId());
>>   return "Written to Session";
>>  }
>> }
>>
>>   On Thu, Jul 29, 2010 at 6:53 AM, Abdul <abdul...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> This may help for you..
>>>
>>>
>>> http://www.solutionhacker.com/data-intelligence/data-visualization/flex-remoting-and-session-management/
>>>
>>>
>>>
>>>
>>> On 29 July 2010 13:03, Sarma <ramasarma...@gmail.com> wrote:
>>>
>>>> Hi to all,
>>>>
>>>>
>>>>  How to maintain the flex session in flex application. If have any
>>>> examples please forward to me.
>>>>
>>>>
>>>> Thanks & Regards,
>>>> M R R Sarma
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Flex India Community" group.
>>>> To post to this group, send email to flex_in...@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> flex_india+unsubscr...@googlegroups.com<flex_india%2bunsubscr...@googlegroups.com>
>>>> .
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/flex_india?hl=en.
>>>>
>>>>
>>>
>>>
>>> --
>>> *With Regards*,
>>> *Nizar.*
>>> *Disturb @ (+91) 9790503327*
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Flex India Community" group.
>>> To post to this group, send email to flex_in...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> flex_india+unsubscr...@googlegroups.com<flex_india%2bunsubscr...@googlegroups.com>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/flex_india?hl=en.
>>>
>>
>> --
>>   You received this message because you are subscribed to the Google
>> Groups "Flex India Community" group.
>> To post to this group, send email to flex_in...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> flex_india+unsubscr...@googlegroups.com<flex_india%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/flex_india?hl=en.
>>
>
>
>
> --
> Thanks & Regards,
> A  Gerald
>
> --
>  You received this message because you are subscribed to the Google Groups
> "Flex India Community" group.
> To post to this group, send email to flex_in...@googlegroups.com.
> To unsubscribe from this group, send email to
> flex_india+unsubscr...@googlegroups.com<flex_india%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/flex_india?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to flex_in...@googlegroups.com.
To unsubscribe from this group, send email to 
flex_india+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to