我想让用户按下excel按钮,并提示下载excel文件。我通常这样做:Flex:通过Servlet导出Excel
var dest:String = excelEndpoint;
var request:URLRequest = new URLRequest();
request.url = dest;
fr.download(request,'Locates.xls');
fr.addEventListener(HTTPStatusEvent.HTTP_STATUS, handleStatus);
fr.addEventListener(IOErrorEvent.IO_ERROR, handleErr);
但是,现在我需要传递一个对象到servlet。眼看你不能做到这一点与我的URLRequest试图用的HTTPService:
var service:HTTPService = new HTTPService();
service.url = excelEndpoint;
service.method = "POST";
service.showBusyCursor = true;
service.addEventListener("result", httpResult);
service.addEventListener("fault", httpFault);
service.send(myObject);
现在,我可以让我的数据(myObject的)到servlet成功,但我没有得到提示下载。
我该怎么做? HTTPService甚至有可能吗?
感谢您的任何有用的提示。
当你不必通过Java servlet比一堆键/值对更复杂时,你可以做到这一点。但是,就我而言,我需要传递一个复杂的对象;这就是困难。 – fumeng 2011-12-13 21:18:24
在你的问题中,你说你已经能够传递复杂的对象。我引用“现在我可以将我的数据(myObject)成功地发送到servlet”。我读过的问题与将数据正确传递到服务器无关。 – JeffryHouser 2011-12-13 21:23:54