Hi group. There's a GWT form with editable GXT grid. I need to display
a JSP page based on the form data in a separate IFRAME.
I want to encode/decode the form data by means of GWT, and I want to
send this data directly to the JSP page without caching it on server.

Here's the code to post the data to iframe:
  <form method="POST" action="/mypage.jsp" target="myiframeid">
  <input type="hidden" name="serializedString" value="...

to get encoded string:
  public interface ISerializerService extends RemoteService {
      /** allow serialize all types */
      Map dummyMethod(Map param);
  }
  ...
  public static String toString(Object _object) throws
SerializationException  {
      SerializationStreamFactory ssf =
GWT.create(ISerializerService.class);
      SerializationStreamWriter streamWriter =
ssf.createStreamWriter();
      streamWriter.writeObject(_object);
      return streamWriter.toString();
  }

to deserialize
  public Object toObject(String serializedString) throws
SerializationException {
      RPCRequest req = RPC.decodeRequest(serializedString);
      return req.getParameters()[0];
  }

Problems:
- There's no documented way to create RPCRequest on client. You have
to write service class and service method name to the
SerializationStreamWriter, and this may fail in newer GWT versions
- Instead of RPC.decodeRequest(), I could use
ServerSerializationStreamReader.readObject(), but it's marked "For
internal use only", so it's as bad as previous
- GWT claims to support classes that implement both IsSerializable and
Serializable, but to decode the latter, you need an instance of
StandardSerializationPolicy. It can only be obtained from the instance
of RemoteServiceServlet. It's all too complex.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to