Flex與Java整合(endpoint的重要性)
Flex和Java 整合有幾種方法,最常見(jiàn)的是:
一,F(xiàn)lex,java在一個(gè)項(xiàng)目中。
二,F(xiàn)lex,java分別在兩個(gè)項(xiàng)目中。
第一種,直接在新建Flex項(xiàng)目中選擇應(yīng)用服務(wù)器,選擇blazeDS即可。
注意要寫(xiě)上輸出文件夾url.endpoint="messagebroker/amf" 寫(xiě)上相對(duì)路徑即可。
第二種,分別新建Flex ,java 項(xiàng)目,blazeds.war項(xiàng)目中的WebConten/Web-Inf替代java項(xiàng)目下的web-inf。在remoting-config.xml下寫(xiě)上:
<destination id="hxh">
<properties>
<source>com.demo.hxh</source>
</properties>
</destination>
并布署為tomcat.
Flex項(xiàng)目中修改endpoint="/hxh/messagebroker/amf",并設(shè)置輸出文件夾為java ,WebContent下的,輸出文件夾url為java項(xiàng)目,如為http://localhost:8400/hxh
或者新建項(xiàng)目如一,在新建項(xiàng)目java把編譯目錄設(shè)為Flex-webcontent-classes下。
一般問(wèn)題都錯(cuò)在設(shè)置上,endpoint是一個(gè)注意點(diǎn)。
關(guān)于endpoint:
public interface Endpointextends ManageableAn endpoint receives messages from clients and decodes them, then sends them on to a MessageBroker for routing to a service. The endpoint also encodes messages and delivers them to clients. Endpoints are specific to a message format and network transport, and are defined by the named URI path on which they are located.
在 <mx:RemoteObject/> 對(duì)象中指定Endpoint參數(shù):
1) 全路徑: endpoint="http://server:8080/HelloBlazeDS/messagebroker/amf" >
2) 基于contextRoot: endpoint="/HelloBlazeDS/messagebroker/amf" >
3) 基于當(dāng)前路徑: endpoint="messagebroker/amf" >
本文來(lái)自CSDN博客,轉(zhuǎn)載請(qǐng)標(biāo)明出處:http://blog.csdn.net/bill1315/archive/2010/07/21/5751496.aspx
posted on 2010-09-06 16:06 junlin 閱讀(921) 評(píng)論(0) 編輯 收藏