GWT:用于对 URL 片段中的任意数据进行编码/解码的库
Ajax 应用程序,特别是 GWT,使用 URL 片段(例如 http://example.com/myapp#fragment< /a>) 来维护客户端上的应用程序状态,而无需重新加载页面。
是否有一个 GWT 库可以方便地将任意参数编码和解码到 URL 片段中?我正在寻找类似于 Servlet API 的 getParameter() 方法,但对于 客户端 URL 参数。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可能想研究 gwt-platform,它包含读取/修改参数的功能在片段中,以及大量其他出色的 MVP 功能,如 EventBus、Presenters,甚至更简单的 JS 异步加载等。它看起来非常棒。
具体而言,请查看本指南的“使用网址参数”部分。
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.
如果我们谈论 gwt-platform,还有另一个非常好的框架,称为 mvp4g。
Mvp4g 框架的目标是帮助您轻松构建 GWT 应用程序,遵循 Ray Ryan 在 Google I/O:
Event Bus 上展示的最佳实践
依赖注入
模型视图演示者
Place Service
它还包括 HistoryConverter,使 url 参数易于使用。
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 有一个名为“Activities and Places”的内置框架,它使用这些 url 片段。它使书签和历史管理成为可能。
https://developers.google.com/web-toolkit/doc/latest/DevGuideMvpActivitiesAndPlaces
另外,请观看此 I/O 视频(从 18:15 开始)了解其工作原理。
http://www.youtube.com/watch?feature=player_detailpage& ;v=0F5zc1UAt2Y#t=1094s
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