加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

flex 与 servlet 交互

发布时间:2020-12-15 01:14:00 所属栏目:百科 来源:网络整理
导读:关于 flex 与 servlet 之间的交换方式总结一下 1 HTTPService 对于 flex 4 而言可以在fx:Declarations 标签中添加 fx:Declarationsmx:HTTPService id="httpservice" ///添加项/fx:Declarations protected function test():void { //在mxml中获取服务器的各种
关于 flex 与 servlet 之间的交换方式总结一下

1 HTTPService
对于 flex 4 而言可以在<fx:Declarations> 标签中添加

<fx:Declarations>
<mx:HTTPService id="httpservice" />//添加项
</fx:Declarations>


         protected function test():void
         {
                //在mxml中获取服务器的各种参数
                var tempStr:String =Application.application.url;
				var serverName:String =URLUtil.getServerName(tempStr);
				var serverPort:String=URLUtil.getPort(tempStr).toString();
				var serverProtocol:String=URLUtil.getProtocol(tempStr);

                //构建setvlet 请求路径
				var uString:String = serverProtocol + "://" + serverName + ":" +serverPort+"/"+"mobile-store-system/";   //mobile-store-system 工程名
				
				//servlet路径  PrintWord
				var url : String =uString+"PrintWord?type="+type+"&id="+id+"&pfileName="+docname;
				

			    httpservice.url=uString;
                httpservice.send()
			}


2??? flash.net.navigateToURL;
? 可以用来打开新窗口,当然包括与servlet交互
 var url : String =uString+"PrintWord?type="+type+"&id="+id+"&    pfileName="+docname;
	var urlRequest:URLRequest = new URLRequest(url);
	navigateToURL(urlRequest,"_top");

??????? 主要有两种方式? _top? 本页打开
???????????????????????????????? _blank 新窗口
参考: http://blog.minidx.com/2008/08/17/1266.html ???????????? ? ?????

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读