[英]GWT: hermes on server side
我正在嘗試使用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();
}
}
常量是GWT客戶端程序包的一部分,旨在在GWT UI端使用。 對於此接口,GWT.create(ServerConstants.class)將負責創建對象。
但是您要求Hermes為服務器端的GWT接口創建對象。
我希望在這種情況下您不能將兩者混在一起
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.