I’m using Flash 4.0 as UI tier, and I’m trying to send data to the server side, which runs on Tomcat. I wrote a servlet that the calls are directed to it. But I do not understand how can I see the data that was sent from the flash tier. to clarify, hereby example:
Flash tier:
<fx:Declarations>
<s:HTTPService
id="setCustomerDataService"
url="http://localhost:8080/AnalyticsPortalWebUI-1.0/setCustomerData"
useProxy="false" method="POST" resultFormat="text"
result="onSetCustomerDataResult(event)"
fault="fault(event)">
</s:HTTPService>
</fx:Declarations>
<fx:Script>
<![CDATA[
private function onSubmitCustomerDataClick(event:MouseEvent):void
{
var item:UsageInfoItem = new UsageInfoItem();
....
//i use JSON to encode,but it's not related to my question
var data:String = JSON.encode(item);
//query:
setCustomerDataService.send(data);
}
]]>
</fx:Script>
my Servlet:
public void service(HttpServletRequest httpRequest, HttpServletResponse httpResponse)
{
//how can I retrieve "data" from flash here?
}
so my question – how can I retrieve “data” from Flash, in my Servlet?
thanks,
Ohad
found the answer – so I share it here:
in the flash side:
in the server end: