首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 媒体动画 > flex >

flex与jsp通讯

2012-10-26 
flex与jsp通信mx:HTTPService idclientIpDsurlhttp://192.168.10.135:8080/flcds/getIP.jspuseProx

flex与jsp通信

<mx:HTTPService id="clientIpDs"    url="http://192.168.10.135:8080/flcds/getIP.jsp"    useProxy="false" showBusyCursor="true"    resultFormat="text" method="POST"    result="dealResult(event)"    fault="alss(event)"></mx:HTTPService>



<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><%String clientIP = request.getRemoteHost();response.getWriter().print(clientIP); %>



<mx:Script><![CDATA[import mx.rpc.events.FaultEvent;import mx.rpc.events.ResultEvent;import mx.events.CloseEvent;import mx.controls.Alert;import mx.events.ListEvent;import mx.collections.ArrayCollection;[Bindable]private var req_url:String = "http://192.168.10.135:8080/flcds/getIP.jsp";//询问是否与对方建立视频private function ask(evt:ListEvent):void{this.clientIpDs.send();var selectItem:Object = evt.currentTarget.selectedItem;Alert.show("确认请求与"+selectItem.username+"视频吗?","提示",Alert.OK|Alert.CANCEL,this,doRequest);//处理请求function doRequest(evt:CloseEvent):void{if(evt.detail == Alert.OK){}}}//处理获取的客户端IPprivate function dealResult(event:ResultEvent):void{Alert.show("请求成功......","提示");var cIp:String = event.result as String;Alert.show(cIp);}private function alss(event:FaultEvent):void{Alert.show("请求失败......","提示");}]]></mx:Script>

热点排行