Blazeds ÓëFLEXµÄ·¢²¼ÎÊÌâ ÏûϢʵÏÖ
ÔÚͨ¹ýblazedsʵÏÖÏûϢʱ£¬FLEX·¢²¼Ê±ÐèÒªÔÚÉèÖÃÀïÃ潫flexserverÖн«contextrootÓëwebÓ¦ÓõÄcontextrootÃû³ÆÉèÖóÉÒ»ÑùµÄ£¡·ñÔò¾Í²»ÄÜÕýÈ·µÄ½ÓÊÕµ½ÏûÏ¢
ÒÔÏÂÊÇÏà¹ØµÄ²ÎÊýÎÄÕÂ
¹Ø¼ü×Ö: flex blazeds
À´×Ô£ºhttp://hi.baidu.com/%C7%E1%BD%A3/blog/item/33ce7219256b894d42a9ad30.html
Flex µ÷ÓÃÔ¶³Ì»òËùÔÚwebÓ¦ÓÃµÄ BlazeDS·þÎñʱ£¬±ØÐ뽨Á¢ºÍÔ¶¶ËµÄͨµÀchannel,²ÅÄÜÕý³£Í¨ÐÅ¡£
1. ͨ³£µÄ·½Ê½ÊÇ Flex ÔÚ±àÒëʱ¾ÍÖ¸¶¨Ô¶³ÌµÄ¶Ëµã Endpoint£¬service-config.xml ÖеÄEndpoint ÅäÖÃÊÇ ÀýÈ磺
Xml´úÂë
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
±àÒëʱָ¶¨µÄ·½Ê½ÊÇÔÚ¼Ó±àÒë²ÎÊý,ÀýÈ磺
ÒýÓÃ
-services "services-config.xml" -context-root "/HelloBlazeds"
services-config.xml ÐèÒª·ÅÔÚµ±Ç°Ä¿Â¼Ï£¬»òÕßÖ¸¶¨BlazeDSËùÔÚµÄÅäÖÃÎļþ·¾¶¡£
http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postId=12209
2. ÔÚ <mx:RemoteObject/> ¶ÔÏóÖÐÖ¸¶¨Endpoint²ÎÊý£º
ÀýÈ磺
Xml´úÂë
<mx:RemoteObject id="roOrder" destination="Hello" showBusyCursor="true" endpoint="http://server:8080/HelloBlazeDS/messagebroker/amf" >
<mx:RemoteObject id="roOrder" destination="Hello" showBusyCursor="true" endpoint="http://server:8080/HelloBlazeDS/messagebroker/amf" >
1) ȫ·¾¶: endpoint="http://server:8080/HelloBlazeDS/messagebroker/amf" >
2) »ùÓÚcontextRoot: endpoint="/HelloBlazeDS/messagebroker/amf" >
3) »ùÓÚµ±Ç°Â·¾¶£º endpoint="messagebroker/amf" >
×ܽ᣺
¶ÔÓÚFlex+BlazeDS¼¯³É¿ª·¢£¬·½Ê½1£¬ºÍ2.1),2.2) ¶ÔÓÚÆóÒµÓ¦ÓÃÀ´Ëµ¶¼²»ÊÇ×î¼Ñ·½°¸£¬ÒòΪËû½« contextrootдËÀÁË£¬²»±ãÓÚÒÆÖ²£¬Ò²¾ÍÊÇ˵£¬±àÒëºóµÄ swf ·Åµ½ÆäËûÓ¦ÓÃÏÂÎÞ·¨µ÷ÓÃBlazeDS·þÎñ£»
Ïà¹ØÎĵµ£º
flex´úÂ룺
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768">
<fx:Script>
<!--[CDATA[
i ......
1.flex²ú³öÎïµÄÐÎʽÓÐÁ½ÖÖ flashÎļþ »òÕßairÎļþ¡£
1).flashÓÃflash player²¥·Å
2).airÎļþÐèÒªÓÃflexµÄruntimeÔËÐУ¬ÀàËÆjavaµÄjre ºÍ.netµÄ.net runtime
2.ʹÓÃflex builder¿ÉÒÔ¿ÉÊÓ»¯¿ª·¢£¬ÓÐjava»òÕß.net»ù´¡£¬»òÕßjavacript»ù´¡+ÃæÏò¶ÔÏó»ù´¡£¬ÈëÃźÜÈÝÒס£
3.ÌṩÁËһЩÀà¿â£¬¿ÉÒÔʹÓá£
4.Í ......
ÔÚÓÃflex×öWebÓ¦ÓÃʱΪÁËÀ©Õ¹Ó¦ÓóÌÐò¹¦ÄÜ£¬ÊƱػá¸ü¶àµÄͬä¯ÀÀÆ÷½øÐн»»¥£¬ÕâÑù¾Í»áÓõ½ÏÂÃæ½éÉܵÄ֪ʶ
1¡¢ÔÚFlexÖÐʵÏÖURL Ìøת(ʹÓÃflash.net.navigateToURL()·½·¨È磺)
/*
* param1: ÒªÌøתµÄURL
* param2: Ìøת·½Ê½ _blank /_self
*/
navigateToURL(new URLR ......
ÓÃURLLoader¼ÓÔØXML£¬È»ºó½«dataת»¯ÎªByteArray
ÓÃbyteArray.readMultiByte(bytes.length,"utf-8")
È»ºó½«×ª»¯ºóµÄ×Ö·û´®ÔÙÇ¿ÖÆת»¯ÎªXML
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.Binary;
var urlRequest:URLRequest = new URLRequest(source);
loader.addEventListener( ......