There's a GWT application that uses GWT Places/Activities facility. There's also a servlet (currently, not related with GWT by all means) that I need to be able to redirect users to GWT app. Is there a way I can build a Place description in my servlet and then convert it to URL to redirect user to?
Asked
Active
Viewed 552 times
1 Answers
3
If the GWT app uses generated PlaceHistoryMapper implementation, then you can build an instance of the place on the server-side and pass it to its PlaceTokenizer
's getToken method to get the place-specific token, and append to the tokenizer's prefix, with a colon (:
) as a separator.
Otherwise, use the app's place history handler implementation (provided it can be used on the server) and call getToken.
Once you have the history token, then if the app uses the DefaultHistorian, then simply use the token as the hash of the URL. Otherwise, it'll depend on the app's own historian implementation (for instance, if uses the HTML5 History API, then it probably won't use a #
in the URL).

Thomas Broyer
- 64,353
- 7
- 91
- 164
-
Is there a way to get the prefix value from the Place on the server? – Thomas Jul 30 '14 at 12:47
-
Use reflection? (get the `@Prefix` from the `PlaceTokenizer`, or use the place's class name) – Thomas Broyer Jul 31 '14 at 19:24