我正在尝试使用Hermes在GWT中实现服务器端常量。我使用的是Hermes 1.2和GWT2.5。我已经将Hermes添加到我的构建路径中并导入到我的WEB-IF\lib中。
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();
}
}发布于 2013-10-09 06:14:40
Constants是GWT客户端包的一部分,主要用于GWTUI端。对于这个接口,GWT.create(ServerConstants.class)将负责创建对象。
但是你要求Hermes在服务器端为GWT接口创建对象。
我希望你在这种情况下不能把两者都混在一起。
https://stackoverflow.com/questions/19258634
复制相似问题