George Armhold
George Armhold

Reputation: 31074

GWT: library for encoding/decoding arbitrary data in URL fragments

Ajax applications, and GWT in particular, use the URL fragment (e.g. http://example.com/myapp#fragment) to maintain application state on the client without reloading the page.

Is there a GWT library that facilitates the encoding and decoding of arbitrary parameters into the URL fragment? I'm looking for something analogous to the Servlet API's getParameter() method, but for client-side URL parameters.

Upvotes: 0

Views: 1239

Answers (3)

broc.seib
broc.seib

Reputation: 22761

GWT has a built-in framework called "Activities and Places" that employs these url fragments. It makes bookmarking and history managment possible.

https://developers.google.com/web-toolkit/doc/latest/DevGuideMvpActivitiesAndPlaces

Also, watch this I/O video (starts at 18:15) to see how this works.

http://www.youtube.com/watch?feature=player_detailpage&v=0F5zc1UAt2Y#t=1094s

Upvotes: 0

kospiotr
kospiotr

Reputation: 1867

If we talk about gwt-platform there is another very good framework called mvp4g. The goal of the Mvp4g framework is to help you build GWT applications easily, following best practices shown by Ray Ryan at the Google I/O:

Event Bus Dependency Injection Model View Presenter Place Service

It also includes HistoryConverter that makes url parameters easy to use.

Upvotes: 0

Jason Hall
Jason Hall

Reputation: 20920

You may want to investigate gwt-platform, it includes features for reading/modifying parameters in the fragment, as well as a ton of other great MVP features, like EventBus, Presenters, even easier async loading of JS, etc. It looks pretty awesome.

Specifically, check out the "Using URL parameters" section of this guide.

Upvotes: 3

Related Questions