DISQUS

Dobesland: Faster GWT startup with objects embedded in the HTML host page

  • Ken Fehling · 9 months ago
    You should make a class called Lexicographer. A lexicographer is a person who writes dictionaries.
  • dobes_vandermeer · 9 months ago
    LOL, nice idea ...
  • Jim · 4 months ago
    Any chance you could post an example of how to use the DictionaryConstantsWriter class. I think this could be useful in decreasing the load time for one of my GWT components which contains several input picklist fields, each resulting in a RPC call back to the server at load time. An example would be greatly appreciated.
  • dobes_vandermeer · 4 months ago
    Sure, here's an example:

    interface MyInitialData extends DictionaryConstants {
    // ...
    }

    MyInitialData initialData = new MyInitialData() {
    @Override
    public UserInfo myUser() {
    return myUser;
    }
    @Override
    public AuthToken sessionToken() {
    return token;
    }

    };

    request.setAttribute("initialData", DictionaryConstantsWriter.serializeConstants("initialData", initialData, MyInitialData.class, true));

    Then I use this inside a freemarker template as ${initialData}, along with the usual GWT stuff.