GWT出口商.工作实例

编程入门 行业动态 更新时间:2024-10-13 14:28:33
本文介绍了GWT出口商.工作实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个Java库,需要将其转换为JS.我找到了 GWT创建实用程序javascript库以使用gwt-exporter的解决方案.我以前从未使用过GWT.我尝试了 GWT导出程序.入门,但尚不清楚如何使用它.简单地讲,如何运行项目以生成JS?

I have a Java lib and I need to convert it to JS. I found the solution GWT to create utility javascript library to use gwt-exporter. I never used GWT before. I tried GWT-exporter. Getting started but it's not clear how to use it. Simply how to run the project to generate JS?

pom.xml

<dependencies> <dependency> <groupId>org.timepedia.exporter</groupId> <artifactId>gwtexporter</artifactId> <version>2.4.0</version> <scope>provided</scope> </dependency> </dependencies>

Java类:

import org.timepedia.exporter.client.ExporterUtil; public class JS implements EntryPoint { public void onModuleLoad() { // Export all Exportable classes ExporterUtil.exportAll(); }

}

在哪里找到EntryPoint的依赖项?

也许有人可以分享工作示例?

Maybe someone can share working example?

推荐答案

除了将gwt-exporter添加到类路径之外,您是否还继承了gwt-exporter依赖项来更新模块文件(application_name.gwt.xml)?

Apart from adding gwt-exporter to your class-path, did you update your module file (application_name.gwt.xml) inheriting the gwt-exporter dependency?.

如果是这样,在此文件中,您应该有一个指向该应用程序启动时要运行的类的入口标记.打开该Java文件并添加exportAll调用.

If so, in this file you should have an entry-point tag pointing to the class to run when the app starts. Open that java file and add the exportAll call.

最后访问您要在javascript中提供的所有类/方法,并对它们进行适当的注释,如指示入门页面中所示

Finally visit all the classes/methods you want to make available in javascript and annotate them appropriately like in the getting started page is indicated

更多推荐

GWT出口商.工作实例

本文发布于:2023-11-25 20:37:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1631262.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:出口商   实例   工作   GWT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!