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

后端 未结 9 632
离开以前
离开以前 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:52

    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.

    -- Andrej

    This is probably the easiest solution. The only thing to remember with this is that all the classes that you want to serialize should have "public, no-argument" constructor, and (depending upon requirements) setter methods for the member fields.

提交回复
热议问题