如何将现有的JavaScript转换为Java与GWT一起使用? [英] How to convert existing javascript to java to use with GWT?

查看:118
本文介绍了如何将现有的JavaScript转换为Java与GWT一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有将JavaScript转换为java的工具,所以我可以使用GWT处理项目?
$ b

更新



对于那些不知道的人来说,GWT(Google Web Toolkit)是一个编写Java并获得Javascript的工具包,所以我的问题就是这样。

解决方案

你有什么想法?如果您正在寻找某种自动工具,它会从Javascript生成GWT Java代码,那么恐怕没有这种东西。



您可以(也应该)使用 JavaScript Native Interface (JSNI),可能与 JavaScript Overlay Types (JSO)包装你现有的Javascript代码,这样才有可能从GWT的Java代码与它进行交互。查看了解真正的GWT ,第1部分:JSNI (和第2部分)在GWT官方博客上发布了一些指针和用例。


Is there a tool to convert javascript to java, so I can handle the project using GWT?

update

For those who don't know, GWT (Google Web Toolkit) is a toolkit to write Java and get Javascript, so my question.

解决方案

What exactly do you have in mind? If you're looking for some sort of automatic tool, that generates GWT Java code from Javascript, then I'm afraid there's no such thing.

You can (and should) use JavaScript Native Interface (JSNI), probably in combination with JavaScript Overlay Types (JSO) to wrap your existing Javascript code, so that it's possible to interface with it from GWT's Java code. See the Getting to really know GWT, Part 1: JSNI (and Part 2) post on GWT's offcial blog for some pointers and use cases.

这篇关于如何将现有的JavaScript转换为Java与GWT一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆