我正在尝试使用 Hermes 在 GWT 中实现服务器端常量。我正在使用 Hermes 1.2 和 GWT 2.5。我已将 Hermes 添加到我的构建路径并导入到我的 WEB-IF\lib 中。我的服务器包中有一个 ServerConstants.java 文件和 ServerConstants.properties 文件,但是当我去创建一个常量对象时
ServerConstants constants = Hermes.get(ServerConstants.class, "en");
我得到这个错误。
Default constructor cannot handle exception type IOException thrown by implicit super constructor. Must define an explicit constructor
我无法在 ServerConstants.java 中创建构造函数,因为它是一个接口,那么我在这个谜题中到底缺少什么?如果这里重要的是我的 ServerConstants.java 文件
package com.cbs.ioma.server;
import com.google.gwt.i18n.client.Constants;
public interface ServerConstants extends Constants {
String test();
}
}