1 Reply Latest reply on Mar 13, 2008 5:16 AM by SujitG

    How to pass value from JSP page to Flex application

    Thanhvn
      I am creating a small application that using Flex and JSP.
      Using HTTPService we can send request from Flex app to JSP page,where JSP page can process and send the result back to Flex page,usually displayed in a datagrid(with dataProvider property)
      Problem of mine now is how to get the number of record returned from a sql query(got in JSP page) and show that number in Flex page?
      Thanks for any help
        • 1. Re: How to pass value from JSP page to Flex application
          SujitG Level 2
          Hi,

          HTTPService will give you all the content returned by the JSP application. For example if your JSP is giving a HTML content as output, you will get the same in your Flex application. All you need to do is parse the content and get the data from it.
          If your JSP is returning the records returned from a database as an XML then the XML will be something like <products><product>...</product></products> right? Parse this XML and get the nodes count. If you want to just pass the number of rows in a database from a JSP. You can try wrapping the content in an XML and then parse the XML in the Flex application to get the data.

          For more details on how to parse the data from a JSP page, visit the URL below.
          Extracting content from JSP response
          Hope this helps.