开发者

GWT and Ruby on Rails

开发者 https://www.devze.com 2023-01-08 01:04 出处:网络
We have RoR application and we are planning to 开发者_运维百科make js interface(extjs or closure) in new version.

We have RoR application and we are planning to 开发者_运维百科make js interface(extjs or closure) in new version. Is it possible to use GWT with RoR?


Yes, using GWT with RoR is perfectly possible. Client server communication will be by JSON, which RoR can easily produce. GWT works best when you're creating a client side app in HTML/JavaScript/CSS, if you want progressive enhancement of an existing HTML UI jQuery etc. might be a better choice.


As this is still the accepted answer, decided to update with more modern approaches

RESTful API

The tooling for creating and consuming API's has improved markedly.

  • Creating REST JSON API from RoR is simple. Basically set controller to respond to a JSON request and serialise model to JSON

  • Consuming REST API from GWT has a good Stack Overflow answer how-to-call-restful-services-from-gwt

RoR to GWT RPC project (very dated)

The http://code.google.com/p/gwt-rails/ project is intended to provide easy to use RPC between RoR backend, and GWT UI.


You can, but you won't have the nice RPC mechanism available with java based servers. You'll probably have to use RequestBuilder class to pass data to the server & back.


I'm not that familiar with GWT but I guess in theory it's possible to use GWT cross compile Java into JavaScript which is then used within a Rails application. It sounds pretty cumbersome though.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号