`
yunzhongxia
  • 浏览: 640711 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

用Spring BlazeDS Integration 的注解简化flex远程对象配置

    博客分类:
  • flex
阅读更多

       spring提供了扫描组件的功能,例如在一个类Test上标记@Servie那么就可以不用在xml文件中配置Test Bean了。

       在Spring BlazeDS Integration(SBI)中既可以在xml中配置远程对象,简单的配置如下:

      

<flex:remoting-destination ref="org.sdp.context.TestService" destination-id="test" />

 

 

      在实际的项目中,太多的xml配置会带来很多问题,如果我们采用spring的注解就能很好解决这个问题。幸运的是SBI已经为我们想到了这一点。

     

@Service
@RemotingDestination
public class Test2 {
        public String test(String name){
	return "hello"+name;
        }
}

 

  通过以上的配置,我们就可以在flex端访问远程对象了,对象的destination是test2。

  如果了解flamingo+seam开发,你会发现两者如出一辙。

 

@Scope(ScopeType.STATELESS)
@Name("helloAction")
public class HelloAction {
    
    @WebRemote 
    public String hello(String name) {
        return "Hello, " + name;
    }

}

 

 

 

 

    


 

0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics