gwt-rpc

Sending persisted JDO instances over GWT-RPC

馋奶兔 提交于 2019-11-28 20:15:17
问题 I've just started learning Google Web Toolkit and finished writing the Stock Watcher tutorial app. Is my thinking correct that if one wants to persist a business object (like a Stock) using JDO and send it back and forth to/from the client over RPC then one has to create two separate classes for that object : One with the JDO annotations for persisting it on the server and another which is serialisable and used over RPC? I notice the Stock Watcher has separate classes and I can theorise why:

SerializationPolicy error when performing RPC from within GWT application

 ̄綄美尐妖づ 提交于 2019-11-28 19:19:51
I'm getting the following exception: com.google.gwt.user.client.rpc.SerializationException: Type 'java.lang.Long' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized using GWT 2.1 and the built in Jetty server. According to the docs, this type is definitely serializable... How can I include it in the SerializationPolicy? Krzysztof Uroda Here's the link that should resolve problem: http://developerlife.com/tutorials/?p=131 A user defined class is serializable if:

GWT - occasional com.google.gwt.user.client.rpc.SerializationException

六月ゝ 毕业季﹏ 提交于 2019-11-28 18:11:24
we are haunted by occasional occurences of exceptions such as: com.google.gwt.user.client.rpc.SerializationException: Type 'xxx' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom field serializer.For security purposes, this type will not be serialized.: instance = xxx at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:610) at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:129) at com.google.gwt.user.server.rpc

Fake a GWT Synchronous RPC call

…衆ロ難τιáo~ 提交于 2019-11-28 12:26:39
First of all, I know that doing a synchronous call is "wrong", and know that "is not possible". But, in a situation a lot complex (i dont know how to explain), i need to wait the response from server, I'am using the GWT-Platform command implementation for the GWT RPC calls. I was looking for some kind of "hack" for doing this. Thanks in advance. There is a solution but it is not easy (e.g. you cannot flip a single parameter to make it work). GWT is using normal JS XMLHttpRequest under the hood. In GWT there is an overlay type for it called com.google.gwt.xhr.client.XMLHttpRequest. This class

How to get image with servlet and display it using GWT Image class?

蹲街弑〆低调 提交于 2019-11-28 12:26:00
I'm using the following code as part of the GWT server-side class (servlet) for GWT-RPC. private void getImage() { HttpServletResponse res = this.getThreadLocalResponse(); try { // Set content type res.setContentType("image/png"); // Set content size File file = new File("C:\\Documents and Settings\\User\\image.png"); res.setContentLength((int) file.length()); // Open the file and output streams FileInputStream in = new FileInputStream(file); OutputStream out = res.getOutputStream(); // Copy the contents of the file to the output stream byte[] buf = new byte[1024]; int count = 0; while ((count

What is the purpose of the IsSerializable interface in GWT (regarding the RPC mechanism)

蓝咒 提交于 2019-11-28 09:41:32
What is the purpose of the IsSerializable interface in GWT (regarding the RPC mechanism). I have never been able to find a good explanation as to why it is the way it is and why the default Java Serializable tagging interface does not work. Both Serializable and IsSerializable work, according to the GWT serialization docs : A user-defined class is serializable if all of the following apply: It is assignable to IsSerializable or Serializable, either because it directly implements one of these interfaces or because it derives from a superclass that does All non-final, non-transient instance

Problems passing class objects through GWT RPC

一个人想着一个人 提交于 2019-11-27 18:11:57
I've run through the Google Web Toolkit StockWatcher Tutorial using Eclipse and the Google Plugin , and I'm attempting to make some basic changes to it so I can better understand the RPC framework. I've modified the "getStocks" method on the StockServiceImpl server-side class so that it returns an array of Stock objects instead of String objects. The application compiles perfectly, but the Google Web Toolkit is returning the following error: "No source code is available for type com.google.gwt.sample.stockwatcher.server.Stock; did you forget to inherit a required module?" It seems that the

When should I use RequestFactory vs GWT-RPC?

大城市里の小女人 提交于 2019-11-27 16:50:14
I am trying to figure out if I should migrate my gwt-rpc calls to the new GWT2.1 RequestFactory cals. Google documentation vaguely mentions that RequestFactory is a better client-server communication method for "data-oriented services" What I can distill from the documentation is that there is a new Proxy class that simplifies the communication (you don't pass back and forth the actual entity but just the proxy, so it is lighter weight and easier to manage) Is that the whole point or am I missing something else in the big picture? The big difference between GWT RPC and RequestFactory is that

How to Use the GWT-RequestFactory in Android SyncAdapter (always getting ValidationTool-Error)

試著忘記壹切 提交于 2019-11-27 15:15:51
问题 I got a question about the usage of GWT-RequestFactory in Android. As a starting point I used the code from the “Create a AppEngine connected Android-Project”-Wizard (infos: http://code.google.com/intl/de-DE/eclipse/docs/appengine_connected_android.html) and it worked great. But now in my case I want do extend this application to use a local ContentProvider with SQLite and a SyncService with SyncAdapter do synchronize the data from the ContentProvider to the AppEngine using the RequestFactory

SerializationPolicy error when performing RPC from within GWT application

我的未来我决定 提交于 2019-11-27 12:16:29
问题 I'm getting the following exception: com.google.gwt.user.client.rpc.SerializationException: Type 'java.lang.Long' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized using GWT 2.1 and the built in Jetty server. According to the docs, this type is definitely serializable... How can I include it in the SerializationPolicy? 回答1: Here's the link that should resolve