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下写上: 并布署为tomcat.
  Flex项目中修改endpoint="/hxh/messagebroker/amf",并设置输出文件夹为java ,WebContent下的,输出文件夹url为java项目,如为http://localhost:8400/hxh
  或者新建项目如一,在新建项目java把编译目录设为Flex-webcontent-classes下。
  一般问题都错在设置上,endpoint是一个注意点。
  关于endpoint: 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. 在 RemoteObject/> 对象中指定Endpoint参数: 
  1) 全路径:          endpoint="http://server:8080/HelloBlazeDS/messageb roker/amf" > 
  2) 基于contextRoot: endpoint="/HelloBlazeDS/messagebroker/amf" > 
  3) 基于当前路径:   endpoint="messagebroker/amf" > 

猜你喜欢

转载自9hguslo.iteye.com/blog/1572734