tags:

views:

23

answers:

0

I have an application, where I display the data from database in flex datagrid using Servlet as the Controller. I need to replace the servlet with Struts2. For sending Http request, in mxml file, I have replaced the below code

<mx:HTTPService id="userRequest" url="../Servlet?ActionID=ajax" useProxy="false" method="GET" result="send_data(event)">
</mx:HTTPService>

with

<mx:HTTPService id="userRequest" url="../Flash"  useProxy="false" method="GET" result="send_data(event)">
</mx:HTTPService>

where Flash is the action name in struts.xml. The action 'Flash' will redirect to another JSP which fetches the data from database and sends in xml format.

When I run the application, it showing the following Actionscript error :

TypeError: Error #1009: Cannot access a property or method of a null object reference.
 at AlarmDataGrid/send_data()
 at AlarmDataGrid/__userRequest_result()
     at flash.events::EventDispatcher/dispatchEventFunction()    
 at flash.events::EventDispatcher/dispatchEvent()
 at HTTPOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
 at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()
 at mx.rpc::Responder/result()
 at mx.rpc::AsyncRequest/acknowledge()
 at DirectHTTPMessageResponder/completeHandler()
 at flash.events::EventDispatcher/dispatchEventFunction()
 at flash.events::EventDispatcher/dispatchEvent()
 at flash.net::URLLoader/onComplete()

I couldn't find which causes the above error. Do anyone have idea about what is wrong in the code and why this error occurs ???