JunXiu

Flex与Java整合(endpoint的重要性)

Flex和Java 整合有几种方法,最常见的是:

一,Flex,java在一个项目中。

二,Flex,java分别在两个项目中。

第一种,直接在新建Flex项目中选择应用服务器,选择blazeDS即可。

注意要写上输出文件夹url.endpoint="messagebroker/amf" 写上相对路径即可。

第二种,分别新建Flex ,java 项目,blazeds.war项目中的WebConten/Web-Inf替代java项目下的web-inf。在remoting-config.xml下写上:

<destination id="hxh">  
       <properties>  
           <source>com.demo.hxh</source>  
       </properties>  
    </destination>  
并布署为tomcat.

Flex项目中修改endpoint="/hxh/messagebroker/amf",并设置输出文件夹为java ,WebContent下的,输出文件夹url为java项目,如为http://localhost:8400/hxh

或者新建项目如一,在新建项目java把编译目录设为Flex-webcontent-classes下。

一般问题都错在设置上,endpoint是一个注意点。

关于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/> 对象中指定Endpoint参数:

     1) 全路径:          endpoint="http://server:8080/HelloBlazeDS/messagebroker/amf" >
     2) 基于contextRoot: endpoint="/HelloBlazeDS/messagebroker/amf" >
     3) 基于当前路径:   endpoint="messagebroker/amf" >


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/bill1315/archive/2010/07/21/5751496.aspx

posted on 2010-09-06 16:06 junlin 阅读(903) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航:
 

导航

<2010年9月>
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

统计

常用链接

留言簿

随笔分类

随笔档案

文章档案

搜索

最新评论

阅读排行榜

评论排行榜