好的,我想在服务器级别管理常量,所以
com.mattbertolini.hermes.Hermes
是一个解决方案。
请查看我的所有步骤:
1-我下载了
hermes-1.2.0.jar
&导入到正确的eclipse库(没有问题)
2-创建
MyConstantsWithLookup.java
at客户端包
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
我不确定这个警告是什么意思?严重吗?
代码运行正常,但为什么eclipse会生成此警告?