Re: RPC and MapString, Object serialization problem

2010-03-16 Thread kriswpl
Thanks again guys for the response. I was thinking what Paul's solution to take and I like 1st one with: public abstract class PropertyT implements Serializable { T value; } However, I don't see what way GWT serializer may know in this service method: HashMapString, Property? getFoo();

Re: RPC and MapString, Object serialization problem

2010-03-16 Thread Paul Robinson
It's not the same problem. With an RPC method of HashMapString, Property? getFoo(), where Property is abstract, GWT will look for all subclasses of Property on the classpath and build the RPC code for them. If you have one Property subclass per data type, then since the Property subclasses

Re: RPC and MapString, Object serialization problem

2010-03-12 Thread kriswpl
Thank you Paul for your reply. FYI - I use Map not to use DTO - I put all properties (Long, Date) to this Map. So I have another question --- is it any way to define what kind of objects (Date, Long, Double, etc.) can show in Map. I found information @gwt.typeArgs something. I mean - is it

Re: RPC and MapString, Object serialization problem

2010-03-12 Thread Martin Trummer
I strongly recommend to use DTO's because then you have all the benefits of type-safety which is one of the most compelling reasons to use GWT. however, if you really don't care about that, you could use a HashMapString, String and simply call the toString() method on the serverside for every

Re: RPC and MapString, Object serialization problem

2010-03-12 Thread Paul Robinson
You can create a class that wraps everything you might want to transport and use that class in the interface instead. One way is like this: public abstract class PropertyT implements Serializable { T value; } public class LongProperty extends PropertyLong { } public

RPC and MapString, Object serialization problem

2010-03-11 Thread kriswpl
Hi, I tried to invoke a method in interface thru RPC. Interface method is: public MapString, Object test(); and in implementation I put into returned map, object java.util.Long (which is serializable:) ): map.put(long, new Long(1)); and I get an error - see below: BUT, when I add another method

Re: RPC and MapString, Object serialization problem

2010-03-11 Thread Paul Robinson
kriswpl wrote: Interface method is: public MapString, Object test(); and in implementation I put into returned map, object java.util.Long (which is serializable:) ): map.put(long, new Long(1)); Where do I do it wrong? GWT does a great job of putting as little into the javascript as