【发布时间】:2012-04-20 22:03:32
【问题描述】:
我想从现有的 Java 项目 (original question here) 生成 Javascript 代码。
我将 GWT 与 gwt-exporter 结合使用。在我 GWT 编译之后,我的类型都没有出现在任何生成的代码中。
我有
GameEntryPoint.java
package game.client;
import org.timepedia.exporter.client.ExporterUtil;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.JavaScriptObject;
public class GameEntryPoint implements EntryPoint {
@Override
public void onModuleLoad() {
ExporterUtil.exportAll();
}
}
RoadServer.java
package game.client;
import org.timepedia.exporter.client.Exportable;
public class RoadServer implements Exportable {
int _index;
int _id;
public RoadServer(int index,int id){
this._id=id;
this._index=index;
}
}
在我的war/ 目录中的任何地方都没有对RoadServer 的引用(grep -Ri RoadServer war/* 仅匹配.class 文件)。此外,为了确定起见,我在浏览器 (Firefox) 中打开了 war/GameEntryPoint.html 文件,而 Firebug 仅将 game_GameEntryPoint 视为以 game 开头的内容。
知道为什么这不起作用吗?
附:我还尝试用@ExportPackage("game") 指定@Export 和@Export("RoadServer")。没有任何效果。
【问题讨论】:
标签: java javascript gwt code-generation