ConfigProperty.idPropertyMap
is filled on the server side. (verified via log output)
Accessing it on the client side shows it's empty. :-( (verified via log output)
Is this some default behaviour? (I don't think so)
Is the problem maybe related to the inner class ConfigProperty.IdPropertyMap
, java.util.HashMap
usage, serialization or some field access modifier issue?
Thanks for your help
// the transfer object public class ConfigProperty implements IsSerializable, Comparable { ... static public class IdPropertyMap extends HashMap implements IsSerializable { ... } protected static IdPropertyMap idPropertyMap = new IdPropertyMap(); ... } // the server service public class ManagerServiceImpl extends RemoteServiceServlet implements ManagerService { ... public IdPropertyMap getConfigProps(String timeToken) throws ConfiguratorException { ... } }
added from below after some good answers (thanks!):
answer bottom line: static field sync is not implemented/supported currently. someone/me would have to file a feature request
just my perspective (an fallen-in-love newby to GWT :-)):
I understand pretty good (not perfect! ;-)) the possible implications of "global" variable syncing (a dependency graph or usage of annotations could be useful). But from a new (otherwise experienced Java EE/web) user it looks like this:
you create some
myapp.shared.dto.MyClass
class (dto = data transfer objects)you add some static fields in it that just represent collections of those objects (and maybe some other DTOs)
you can also do this on the client side and all the other static methods work as well
only thing not working is synchronization (which is not sooo bad in the first place)
BUT: some provided annotation, let's say @Transfer static Collection<MyClass> myObjList;
would be handy, since I seem to know the impact and benefits that this would bring.
In my case it's rather simple since the client is more static, but would like to have this data without explicitely implementing it if the GWT framework could do it.
protected ... idPropertyMap
topublic ...
did not help. – Andreas Covidiot