Using GWT with the MVP pattern, I’d like to have a place that represents a somewhat more complex state (as opposed to the canonical example that has only a “name”). My first inclination was to use a shared transfer object that I would serialize for the token. However, Gson (the serialization library I’m using), does not appear to be GWT compatible.
I started down the path of manually serializing and deserializing myself, but this seemed like a use case that must be fairly common. So my question is: what is the “ordinary” means of tokenizing a the complex state of a place?
History tokens are part of URL and show up in the browser address bar. To make this work you’d first need to serialize them, then URL encode them. Also there are practical limits to how long the URL can be: What is the maximum length of a URL in different browsers?
Do you plan to bookmark this URL? If not, you should just store the object in a map under some ID and include this id in a token.
If you do need to go down your route then generating JSON in GWT is most easily done via Overlay Types.