非Java服务器上运行GWT [英] run GWT on non java server

查看:163
本文介绍了非Java服务器上运行GWT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我觉得我的问题的答案是NO。但尽管如此,我想知道是否有可能运行GWT的一个应用作为前端比如apache httpd的服务器上。该编译GWT的想法是纯JavaScript,不需要Java后端(如果我们不使用基于Java RPC)

I think answer on my question is NO. But still, I'm wondering is it possible to run gwt applicaton as frontend for example on Apache HTTPD server. The idea that compiled gwt is pure javascript and don't need java backend (if we don't use java based RPC)

推荐答案

有什么能阻止你。 GWT code分解为两部分;服务器端和客户端code。至于你说的客户端code编译成可被httpd的轻松担任了纯JavaScript。

There's nothing stopping you. GWT code breaks down into two parts; server-side and client-side code. As you say the client-side code compiles down into pure javascript which can be easily served up by httpd.

在服务器上使用GWT的类的主要优点是通过你的RPC请求,将在客户端code与你的一部分没有工作的Java对象到达时的数据。但是你可以用轻松地调用任何旧的服务<一个href=\"http://google-web-toolkit.google$c$c.com/svn/javadoc/2.3/com/google/gwt/http/client/RequestBuilder.html\"相对=nofollow> RequestBuilder 类,或<一个href=\"http://google-web-toolkit.google$c$c.com/svn/javadoc/2.3/com/google/gwt/xhr/client/XMLHtt$p$pquest.html\"相对=nofollow> XMLHtt prequest 如果你需要更多的控制。

The main advantage of using gwt's classes on the server is that data you request via RPC will arrive in your client code as java objects with no work on your part. But you can easily make calls to any old service using the RequestBuilder class, or XMLHttpRequest if you need more control.

编辑:有是你应该做的,以确保httpd的与你的客户端GWT code效果很好的配置的一个特殊的位:

There is one special bit of configuration you should do to make sure httpd works well with your client-side gwt code:

<Files *.nocache.*>
    ExpiresDefault "access"
</Files>
<Files *.cache.*>
    ExpiresDefault "now plus 6 months"
</Files>

这可以确保当您上传应用程序用户的浏览器的新版本会自动下载它,也可以确保他们不会每次访问您的网站时下载整个应用程序。非常有用的。

This makes sure that when you upload a new version of the app users' browsers will download it automatically, but also makes sure that they won't download the entire app every time they visit your website. Very useful.

这篇关于非Java服务器上运行GWT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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