在哪里可以配置参数在GWT? [英] Where to strore config parameteres in GWT?
本文介绍了在哪里可以配置参数在GWT?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以在客户端存储配置参数?我不可能存储参数在Servlet初始化参数(web.xml)(因为我必须使用PHP)。那么如何在客户端存储init应用程序参数(例如PHP脚本位置,一些密码等)?
解决方案
为此,您有以下选项:
- 在客户端代码中存储数据。 GWT编译为javascript,最简单的方法是创建一个带有硬编码值的
配置
类。 - 将数据浏览器。您可以使用Cookie或HTML5 本地存储
- 商店
- Store data in client side code. GWT compiles down to the javascript and the simplest way to do this is to create a
Configuration
class with hardcoded values. - Store data in a browser. You can use cookies or HTML5 local storage
- Store data on a server side and retrieve them using remote RPC.
我建议你使用第三个选项。
Where I can store configuration parameters in client side? I haven't possibility to store parameters in Servlet init parameters(web.xml) (because I must use PHP). So how I can store init application parameters (for example PHP script location, some passwords etc.) on client side?
解决方案
To do this you have a following options:
I would recommend you go with third option.
这篇关于在哪里可以配置参数在GWT?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文