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

后端 未结 9 631
离开以前
离开以前 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 01:54

    The whitelist is generated by the GWT compiler and contains all the entries that are designated by the IsSerializable marker interface.

    To add a type to the list you just need to make sure that the class implements the IsSerializable interface.

    Additionally for serialization to work correctly the class must have a default no arg constructor (constructor can be private if needed). Also if the class is an inner it must be marked as static.

提交回复
热议问题