首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GWT:服务器端的hermes

GWT:服务器端的hermes
EN

Stack Overflow用户
提问于 2013-10-09 05:19:23
回答 1查看 145关注 0票数 0

我正在尝试使用Hermes在GWT中实现服务器端常量。我使用的是Hermes 1.2和GWT2.5。我已经将Hermes添加到我的构建路径中并导入到我的WEB-IF\lib中。

代码语言:javascript
复制
ServerConstants constants = Hermes.get(ServerConstants.class, "en");

我得到了这个错误。

代码语言:javascript
复制
Default constructor cannot handle exception type IOException thrown by implicit super constructor. Must define an explicit constructor

我不能在ServerConstants.java中创建构造函数,因为它是一个接口,那么在这个难题中我到底遗漏了什么呢?如果重要的话,这里是我的ServerConstants.java文件

代码语言:javascript
复制
package com.cbs.ioma.server;

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

public interface ServerConstants extends Constants {

    String test();

    }
}
EN

回答 1

Stack Overflow用户

发布于 2013-10-09 06:14:40

Constants是GWT客户端包的一部分,主要用于GWTUI端。对于这个接口,GWT.create(ServerConstants.class)将负责创建对象。

但是你要求Hermes在服务器端为GWT接口创建对象。

我希望你在这种情况下不能把两者都混在一起。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19258634

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档