I’m trying to pass arguments of type Class[] and Object[] to a service which implements reflection to find the invoke the required method On the server.Here is the method signature
public void invokeMethod(String methodName,Class [] params,Objects [] args){
................
}
I have read that Object and Class aren’t serializable in Gwt, So is there any workaround for this?
Thanks
Not really. The GWT compiler needs to know every class you’re going to serialise so that it can generate appropriate stubs, etc. for you. If the number of things you’re going to pass inside the
Object[]is limited, then you can hack around this by adding a method to your interface like this:When the GWT compiler encounters this, it will generate the appropriate marshalling code for MyFirstClass, MySecondClass, etc., but it is an ugly hack.