如何正确使用com.mattbertolii.hermes.hermes在服务器端(GWT)管理常量?

如何正确使用com.mattbertolii.hermes.hermes在服务器端(GWT)管理常量?,gwt,gwtp,Gwt,Gwtp,好的,我想在服务器级别管理常量,所以com.mattbertolini.hermes.hermes是一个解决方案 请参阅我的所有步骤: 1-我下载了hermes-1.2.0.jar&导入到正确的eclipse库中(没问题) 2-在客户端包中创建MyConstantsWithLookup.java import com.google.gwt.i18n.client.ConstantsWithLookup; public interface MyConstantsWithLookup extend

好的,我想在服务器级别管理常量,所以
com.mattbertolini.hermes.hermes
是一个解决方案

请参阅我的所有步骤:

1-我下载了hermes-1.2.0.jar&导入到正确的eclipse库中(没问题)

2-在客户端包中创建MyConstantsWithLookup.java

import com.google.gwt.i18n.client.ConstantsWithLookup;

public interface MyConstantsWithLookup extends ConstantsWithLookup {
    String myMsg();
}
3-在同一客户端软件包中创建MyConstantsWithLookup.properties文件。该文件包含以下行:

myMsg=Deleted
4-在服务器包中的ServerData.java中

MyConstantsWithLookup my = Hermes.get(MyConstantsWithLookup.class, "");
String  extra=my.myMsg();
在eclipse中测试时,它工作正常,但我在eclipse中收到警告消息:

[WARN] Server class 'com.ibm.icu.util.ULocale' could not be found in the web app, but was found on the system classpath [WARN] Adding classpath entry 'file:/C:/Users/eclipse-jee-juno-SR1-win32-x86_64/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.5.0.v201212122042-rel-r42/gwt-2.5.0/gwt-dev.jar' to the web app classpath for this session For additional info see: file:/C:/Users/eclipse-jee-juno-SR1-win32-x86_64/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.5.0.v201212122042-rel-r42/gwt-2.5.0/doc/helpInfo/webAppClassPath.html [警告]在web应用程序中找不到服务器类“com.ibm.icu.util.ULocale”,但在系统类路径中找到 [警告]将类路径条目“文件:/C:/Users/eclipse-jee-juno-SR1-win32-x86_64/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.5.0.v2012122042-rel-r42/gwt-2.5.0/gwt-dev.jar”添加到此会话的web应用程序类路径 有关更多信息,请参阅:文件:/C:/Users/eclipse-jee-juno-SR1-win32-x86_64/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.5.0.v2012122042-rel-r42/gwt-2.5.0/doc/helpInfo/webAppClassPath.html 我不知道这个警告是关于什么的?严重吗

代码运行正常,但eclipse为何生成此警告?

此类(
com.ibm.icu.util.ULocale
)是
java.util.Locale
的替代品,因此Hermes似乎依赖于它

从下载ICU4JJAR,并将其添加到项目的构建路径中

资料来源:马特·贝托利尼

您需要添加位于的ICU4j jar 到您的类路径。你在医院里上ICU课的原因是什么 gwt-dev.jar是因为gwt在Java到JavaScript中包含了它们 编译器。这是令人遗憾的,因为它经常错误地报道事件 类路径上的文件