Flex和Java 整合


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 Endpoint
   
   
    
    extends 
    
    Manageable
   
   

An 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" >

 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值