[英]GWT Application Configuration File
I am really confused and hoping someone can give some direction. 我真的很困惑,希望有人能提供一些指导。 I am working on a GWT Spring application and want to store some application specific data in an xml config file which can be accessed on the server side.
我正在处理GWT Spring应用程序,并希望将一些应用程序特定的数据存储在xml配置文件中,该文件可以在服务器端进行访问。 How and where should I store this and how can I access this data.
我应如何以及在何处存储此数据以及如何访问此数据。
I want to do the same thing that the appSettings.config does in c#.net. 我想做与appSettings.config在c#.net中所做的相同的事情。
thanks. 谢谢。
war/WEB-INF
That folder is accessible by the server-side code, but not any clients over the internet. 该文件夹可通过服务器端代码访问,但不能通过Internet访问任何客户端。
Sources : 资料来源 :
http://tomcat.apache.org/tomcat-7.0-doc/appdev/source.html#Directory_Structure http://docs.oracle.com/cd/E13222_01/wls/docs70/webapp/basics.html#136976 http://tomcat.apache.org/tomcat-7.0-doc/appdev/source.html#Directory_Structure http://docs.oracle.com/cd/E13222_01/wls/docs70/webapp/basics.html#136976
Reading the file 读取文件
I suggest storing your configuration in a Java Properties file (eg: config.properties). 我建议将您的配置存储在Java属性文件中(例如:config.properties)。 That way you can load and read easily using
java.util.Properties
, as described on this stackoverflow post . 这样,您可以使用
java.util.Properties
轻松加载和阅读, 如本stackoverflow上所述 。
java.util.Properties
also lets you load from an XML file . java.util.Properties
还允许您从XML文件加载 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.