【问题标题】:GWT - Fail to Read propertiesGWT - 无法读取属性
【发布时间】:2011-01-07 16:30:24
【问题描述】:

当我在托管模式下运行时,它能够得到结果。

但是当我将它部署到 tomcat 时,我根本无法得到结果。

谁能告诉我是什么问题??

公共类 Customwidget 实现 EntryPoint {

私有静态最终 SystemConfig 常量 = (SystemConfig)GWT.create(SystemConfig.class);

公共无效 onModuleLoad() { Window.alert(constants.DBServerName()); }

SystemConfig.properties: DBServerName=guaz

SystemConfig.java: 导入 com.google.gwt.i18n.client.Constants;

公共接口 SystemConfig 扩展常量 { 字符串 DBServerName(); 字符串 DB_ServerName(); 字符串 DB_PortNumber(); 字符串 DB_DatabaseName(); 字符串 DB_IntegratedSecurity(); 字符串 DB_Password(); 字符串 DB_User(); }

谢谢

【问题讨论】:

  • 您是否记录了任何类型的错误?

标签: file gwt properties constants


【解决方案1】:

您的属性文件必须位于/复制到您的网络应用程序的 /WEB-INF/classes 子文件夹中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-22
    • 2018-05-13
    • 2015-03-29
    • 2018-07-04
    相关资源
    最近更新 更多