5 Replies Latest reply on Nov 2, 2009 4:06 AM by SEO UK

    Using HTTPService to pass data from Flex to JSP

    Sangeetha AV Level 1

      Hi  All,

       

      Iam trying to pass data from flex to jsp using <mx:HTTPService> on a button click. This is the MXML code:

       

       

       

       

       

      <mx:HTTPService

       

       

      id="loadJSPService" useProxy="false" method="POST

      "

      url="

       

      http://localhost:9999/ctsDS/MyFlexProject-debug/GateBoarding.jsp"

      />

       

       

       

      <mx:HBox height="100%" width="1005" horizontalScrollPolicy="off"

      >

       

       

      <mx:Button id="Click" label="Click" click="javascriptCall()"

      ></mx:Button>

       

      javascriptCall() is  a call to the Actionscript function. This is the Actionscript function:

       

      public

       

       

      function javascriptCall():void{

          

      var

       

      fltName:String="BA123";

      loadJSPService.cancel();

      loadJSPService.send(fltName);

      }

       

       

       

       

       

       

       

      This is just a sample Iam trying to do. In JSP page I get this data using request.getParameter("fltName");

       

      When I run this application, I get an error saying

       

      ReferenceError: Error #1065: Variable fltName is not defined.

       

      What could be wrong??

       

      Please if someone could help.

       

      Regds

      Sangeetha