jabsorb
Java to JavaScript Object Request Broker

To use constructors:

First you need to declare some imports in your servlet (see unit.jsp)

The class that you want to call constructors on needs to be registered as a callable reference and have its class registered:

JSONRPCBridge.registerCallableReference(org.jabsorb.test.ConstructorTest.class);
JSONRPCBridge.registerClass("ConstructorTest",org.jabsorb.test.ConstructorTest.class);

With this done, you call constructors so:

var constructorTest = jsonrpc.createObject("ConstructorTest",[arg1, arg2, arg3])
constructorTest.someMethod()

Note the first argument to createObject() "ConstructorTest" must be the same as the first argument to registerClass()

And that is it! You can now call constructors to your hearts content!