当前页面: 开发资料首页 → 业界新闻 → DWR 2.0M2 增加支持 annotation
摘要: Maik Schreiber 之前提到 在DWR 2.0M2版本中 增加了annotation support 。DWR中一些使用annotation 的地方......
//To make a simple class available for remote access, use the @Create and @RemoteMethod annotations:
@Createpublic class RemoteFunctions
{
@RemoteMethod
public int calculateFoo() {
return 42;
}
}
//To make simple bean classes available for remote access, use the @Convert and @RemoteProperty annotations:
@Convertpublic class Foo {
@RemoteProperty private int foo;
public int getFoo() {
return foo;
}
@RemoteProperty
public int getBar() {
return foo * 42;
}
}