Hi,
Am 10.09.2007 um 15:18 schrieb Siarhei Barysiuk:
> Have one question about Java RPC backend for qooxdoo.
> I try to explain with a little example.
> For example in service I have method
>
> ...
> public void echo(String a,Bean b){
> return a+b;
> }
> ...
>
> where Bean is org.some.package.Bean
>
> public class Bean{
> int a;
> int b;
> ...
> }
This won't work. The RPC backend only handles properties that follow
JavaBean conventions:
public class Bean {
private int a;
private int b;
public int getA() {
return a;
}
public void setA(int a) {
this.a = a;
}
public int getB() {
return b;
}
public void setB(int b) {
this.b = b;
}
}
> and in javascript I pass to this service following
> data
>
> [ 'hello', {a:1,b:2}].
>
> Does backend call this method?
Yes (provided you use JavaBean conventions as pointed out above). The
actual syntax would look like this:
var rpc = ...;
rpc.callAsync(handler, "echo", "hello", {a:1, b:2});
> Notice that I don't define
> class hinting 'class':'org.some.package.Bean' in my data.
> Do I need to define every time java class explicitly?
No. As long as it's a standard bean with getters and setters, it
should "just work" (TM).
Regards,
Andreas
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel