How do I add a type to GWT's Serialization Policy whitelist?

后端 未结 9 634
离开以前
离开以前 2020-11-30 01:30

GWT\'s serializer has limited java.io.Serializable support, but for security reasons there is a whitelist of types it supports. The documentation I\'ve found,

9条回答
  •  囚心锁ツ
    2020-11-30 02:02

    I found that just putting it in the client package or using it in a dummy service interface was not sufficient as it seemed the system optimized it away.

    I found it easiest to create a class that derived from one of the types already used in the service interface and stick it in the client package. Nothing else needed.

    public class GWTSerializableTypes extends SomeTypeInServiceInterface implements IsSerializable {
        Long l;
        Double d;
        private GWTSerializableTypes() {}
    }
    

提交回复
热议问题