开发者

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

开发者 https://www.devze.com 2023-01-01 18:41 出处:网络
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.

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 parameter开发者_C百科s into the URL fragment? I'm looking for something analogous to the Servlet API's getParameter() method, but for client-side URL parameters.


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.


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消