I made a java interface with this:
ArrayList<MyObject> getMyObjects();
I then made a serverside class implement this.
I also made something like this:
public class JSMyObjectHolder extends JavaScriptObject implements
MyInterface {
public ArrayList<MyObject> getMyObjects() /*-{
return this.myObjects;
}-*/;
So.. if I deploy/run this.. call a serlvet that returns json.. and use
JSONParser to get myself a JSMyObjectHolder...
If i'm in Firefox.. stand alone.. no hosted mode/dev mode.. if I call
getMyObjects().. I can get back an array list.. iterate over it
etc...
But.. if I try in GWT 2.0 to do this in DevMode...
I get a class cast exception, as it *wants* to return it as a
JsArray<MyObject> (which *technically* makes sense.. I mean, a
collection, in javascript, on the client side is implemented via
JsArray).
But like.. why does DevMode die.. but running a regular browser
proceed perfectly?
My goal, is to have one interface that I can implement both ont he
client and server side.. so I can user overlay types on the client ..
and POJO's on the server..
But of course, it is important to have access to DevMode :)
Thanks,
Roger
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.