Neil Aggarwal schrieb am Donnerstag, 19. Dezember 2024 um 17:12:06 UTC+1:
> Enumeration constants are serialized as a name only; none of the field values are serialized.
What are the consequences of not having the values?
The consequence is that your enums should never ever have changing data stored. For example MyEnum.PERSON.getFriends().add(friend) is possible in Java but makes the enum constant mutable, which is bad. If enum constants are immutable then serializing the name or ordinal is enough to reconstruct the state.
> Can you confirm that the policy file does include Line
It does not have Line in it:
Does Line satisfy all rules? Default constructor, implements Serializable and only has Serializable fields? If yes, take a look at your GWT-RPC service method(s) declaration. Starting from the return type and the parameter types of the GWT-RPC method(s), will Line be discoverable directly or is it hidden behind some interface or super class or possibly class Object and GWT would need to find all the candidates that match these interfaces/super classes? If Line is hidden, do the interface / super class follow the rules? Maybe Line isn't the only class that is missing in the policy file?
As a workaround you can always add dummy methods to your GWT-RPC service, e.g. Line getDummyLine(), to make a class visible to GWT (or a Dummy class with a Line field and then use Dummy as return type).
-- J.
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/d7ee6beb-815d-44ab-8a3f-c292ee198e27n%40googlegroups.com.
No comments:
Post a Comment