简体   繁体   中英

GWT: hermes on server side

I am trying to implement server side constants in GWT using Hermes. I'm using Hermes 1.2 and GWT 2.5. I've added Hermes to my build path and imported into my WEB-IF\\lib. I have a ServerConstants.java file and ServerConstants.properties file in my server package but when I go to create a constants object with

ServerConstants constants = Hermes.get(ServerConstants.class, "en");

I get this error.

Default constructor cannot handle exception type IOException thrown by implicit super constructor. Must define an explicit constructor

I cannot create a constructor in ServerConstants.java because it is an interface, so what exactly am I missing in this puzzle? if it matters here is my ServerConstants.java file

package com.cbs.ioma.server;

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

public interface ServerConstants extends Constants {

    String test();

    }
}

Constants is part of client package of GWT, it is intended to use in GWT UI side. For this interfaces GWT.create(ServerConstants.class) will take care of creating object.

But you are asking Hermes to create Object for GWT interface, that to on server side.

I hope you cannot mix both in this case

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM