3 Replies Latest reply on Sep 2, 2009 12:51 PM by Mauro@Uy

    How to access/modify portlet session attributes from flex application?

    Mauro@Uy

      Hi everybody,

       

      Following the guidelines in the article  "Using Macromedia Flex in a Portal Environment", I've  successfully developed and deployed a simple hello world portlet using flex.

       

      The article has a slightly more advanced example to show the platform's ability to access and modify the portlet session attributes. I'll paste the example here:

       

      <?xml version="1.0" encoding="utf-8"?>
           
      <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"/>

          <mx:RemoteObject id="sessionObj" source="servlet" showBusyCursor="true"/>

          <mx:HBox>
              <mx:TextInput id="fromSession" text="{sessionObj.session.result}"/>
              <mx:Button label="Get userName Session Attribute" click="sessionObj.session('get', 'userName')"/>
          </mx:HBox>

          <mx:HBox>
              <mx:TextInput id="toSession"/>
              <mx:Button label="Set userName Session Attribute"
                         click="sessionObj.session('set', 'userName', toSession.text)"/>
          </mx:HBox>

      </mx:Application>

       

       

      Of course this example didn't work, the following message is what one can get:

       

      [RPC Fault faultString="[MessagingError message='The MessageAgent's destination must be set to send messages.']" faultCode="InvokeFailed" faultDetail="Couldn't establish a connection to ''"]

       

      The issue is that the example obviously requires some additional setup in the server side.

      what configurations can enable this kind of client-server interaction? perhaps BlazeDs solves this?

       


      Thanks