GWT with non-Java backend

69 views
Skip to first unread message

Joshua Partogi

unread,
Nov 30, 2008, 7:31:18 PM11/30/08
to Google-We...@googlegroups.com
Dear all,

Has anyone worked GWT with non-Java backend (like PHP or Rails) and
send it with AJAX Http request? Does it work good? I am wondering
whether this is a good approach. I would appreciate any experience
shared here.

Thank you in advance

--
Not by might nor by power, but by His Spirit.

Read my blog: http://joshuajava.wordpress.com/
Follow me on twitter: http://twitter.com/jpartogi

Martin Gorostegui

unread,
Nov 30, 2008, 8:15:35 PM11/30/08
to Google-We...@googlegroups.com
Yes,
 
I´m working with GWT with a PHP backend and I know many people in this list also do that. It is an excellent approach if you can't have a Java backend but want to have all the benefits of GWT (except for the optimised GWT Java RPC).
Basically what you should do is instead of using GWT Java RPC (extending RemoteService, RemoteServiceServlet and creating an AsyncInterface) is use the RequestBuilder class to make http calls. What you send and receive can be anything you want but JSON is what is most used. For dealing with JSON client-side you can use GWT own JSON classes and Javascript Overlay Types if you are with GWT 1.5, and for dealing with JSON serverside you can use any PHP, Ruby, etc library to encode\decode JSON.
 
I recommend you search this list archives as there are tons of messages about what I'm telling you (even people who is using JSONP instead, or json.org JSONRequest or the ones who have created their own way of dealing with JSON client-side). Also this section of the official documentation should be useful for you: http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=DevGuideServerCalls
 
Hope this helps,
 
Martin

mikeds...@gmail.com

unread,
Nov 30, 2008, 10:04:08 PM11/30/08
to Google Web Toolkit
I too have worked on GWT front with PHP in the backend, communicating
as Martin stated using RequestBuilder and exclusively JSON. Quite
simple really. I've also built a prototype Ruby backend to the same
frontend and it too was pretty easy, and I'm a bit of a Ruby noob.
Martin's guidance is dead on...search this area for many examples,
they are there!

Later,
Shaffer

On Nov 30, 6:15 pm, "Martin Gorostegui" <martin.goroste...@gmail.com>
wrote:
> Yes,
>
> I´m working with GWT with a PHP backend and I know many people in this list
> also do that. It is an excellent approach if you can't have a Java backend
> but want to have all the benefits of GWT (except for the optimised GWT Java
> RPC).
> Basically what you should do is instead of using GWT Java RPC (extending
> RemoteService, RemoteServiceServlet and creating an AsyncInterface) is use
> the RequestBuilder class to make http calls. What you send and receive can
> be anything you want but JSON is what is most used. For dealing with JSON
> client-side you can use GWT own JSON classes and Javascript Overlay Types if
> you are with GWT 1.5, and for dealing with JSON serverside you can use any
> PHP, Ruby, etc library to encode\decode JSON.
>
> I recommend you search this list archives as there are tons of messages
> about what I'm telling you (even people who is using JSONP instead, or
> json.org JSONRequest or the ones who have created their own way of dealing
> with JSON client-side). Also this section of the official documentation
> should be useful for you:http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=goog...
>
> Hope this helps,
>
> Martin

Joshua Partogi

unread,
Nov 30, 2008, 11:06:22 PM11/30/08
to Google Web Toolkit
Thank you so much Martin for the hint. :-)
I am more confident now to use GWT with non-Java backend. Because I
thought people only use GWT with Java on the backend.

Cheers.

On Dec 1, 12:15 pm, "Martin Gorostegui" <martin.goroste...@gmail.com>
wrote:
> Yes,
>
> I´m working with GWT with a PHP backend and I know many people in this list
> also do that. It is an excellent approach if you can't have a Java backend
> but want to have all the benefits of GWT (except for the optimised GWT Java
> RPC).
> Basically what you should do is instead of using GWT Java RPC (extending
> RemoteService, RemoteServiceServlet and creating an AsyncInterface) is use
> the RequestBuilder class to make http calls. What you send and receive can
> be anything you want but JSON is what is most used. For dealing with JSON
> client-side you can use GWT own JSON classes and Javascript Overlay Types if
> you are with GWT 1.5, and for dealing with JSON serverside you can use any
> PHP, Ruby, etc library to encode\decode JSON.
>
> I recommend you search this list archives as there are tons of messages
> about what I'm telling you (even people who is using JSONP instead, or
> json.org JSONRequest or the ones who have created their own way of dealing
> with JSON client-side). Also this section of the official documentation

ajay jetti

unread,
Nov 30, 2008, 11:08:32 PM11/30/08
to Google-We...@googlegroups.com
This should help i think
 
 
yours
 
Ajay

Peter Ondruška

unread,
Dec 1, 2008, 4:01:41 AM12/1/08
to Google-We...@googlegroups.com
I use GWT with Google App Engine backend with RequestBuilder.

2008/12/1, ajay jetti <program...@gmail.com>:

Reinier Zwitserloot

unread,
Dec 1, 2008, 6:02:29 AM12/1/08
to Google Web Toolkit
Yes, tons of people have used GWT on the front and something that
isn't java on the back-end. You can transfer data using JSON, XML
(but, really, don't. XML is stupid as a wire protocol), or whatever
binary format you think is useful.

The only caveat (and this applies to using GWT-RPC as well), is that
GWT apps can only receive data 'whole'. You can not stream. So, if you
were thinking of pumping 50 megabytes worth of data down to the
client, you need to split it up into pieces and have the GWT client
app request and process each piece one at a time. The general idea of
processing 50 MB worth of stuff in a javascript app also doesn't sound
like a good idea in general, as javascript isn't really fast enough to
do it unless you're on WebKit+SquirrelFish, Google Chrome+V8, or
Firefox 3.1 beta + tracemonkey. (Those are all beta or small market
share browsers with amazing javascript interpreters).


On Dec 1, 10:01 am, "Peter Ondruška" <peter.ondru...@gmail.com> wrote:
> I use GWT with Google App Engine backend with RequestBuilder.
>
> 2008/12/1, ajay jetti <programmera...@gmail.com>:

Johan Rydberg

unread,
Dec 1, 2008, 9:43:01 AM12/1/08
to Google-We...@googlegroups.com
Joshua Partogi skrev:

> Dear all,
>
> Has anyone worked GWT with non-Java backend (like PHP or Rails) and
> send it with AJAX Http request? Does it work good? I am wondering
> whether this is a good approach. I would appreciate any experience
> shared here.

I've developed a GWT RPC gateway to Python on the server. It is
tightly integrated with the Twisted networking framework:

http://code.google.com/p/twisted-gwt/

~jr

Eduardo Guardiola

unread,
Dec 1, 2008, 3:52:09 PM12/1/08
to Google Web Toolkit

I'm using .NET on the server (i miss Java, haven't had choice).
Jayrock as JSON-RPC. And a custom implementation of JSON-RPC for GWT
using RequestBuilder of course.

http://jayrock.berlios.de/
Reply all
Reply to author
Forward
0 new messages