Flex 与java 通信,通过BlazeDS


  1. Server代码  package com.east.flex.demo; import com.east.flex.Person; public class HelloWorld { public Person sayHello(String str) { Person p = new Person(); p.setId(2222222); p.setName("East"); p.setSex("man"); return p; } }  package com.east.flex; public class Person { private long id; private String name; private String sex; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public long getId() { return id; } public void setId(long id) { this.id = id; } }  2.Client 代码 package com.east.flex { [RemoteClass(alias="com.east.flex.Person")] public class Person { public var id:Number; public var name:String; public var sex:String; public function Person() { } public function toStrings():String { trace("start Person"); return "ID :"+id+"Name :"+name+"Sex :"+sex; } } }   import com.east.flex.Person      width="430" height="236" id="show" fontSize="36"/>     3.config file             com.east.flex.demo.HelloWorld   

你可能感兴趣的:(blazeds)