For the deployment, Must I use J2EE? Can I use python/TurboGears as the server program?

0 views
Skip to first unread message

xiaya...@gmail.com

unread,
May 17, 2006, 8:33:02 AM5/17/06
to Google Web Toolkit
Hi,

As from what I read, in all the examples it seems that JAVA
environment is necessary to deploy the application. Is it possible to
deploy the application to a non JAVA enabled server program like python
based TurboGears? Thanks a lot.

discus...@gmail.com

unread,
May 17, 2006, 12:08:56 PM5/17/06
to Google Web Toolkit
Yes, you just need to make web services available with whichever server
side enviroment you choose.

Tiago Serafim

unread,
May 17, 2006, 12:13:42 PM5/17/06
to Google-We...@googlegroups.com
Maybe I´m just stupid, but I couldn´t find on documentation how a non-Java(j2ee) server can talk to GWT using the RPC package... any ideas?

Thanks, Tiago

Tiago Serafim

unread,
May 17, 2006, 12:18:12 PM5/17/06
to Google-We...@googlegroups.com
I wasn´t clear on my previous post: I didn´t find how to talk to a non-java server using object Serialization and RPC....
--
Tiago Serafim

Bret Taylor

unread,
May 17, 2006, 12:36:45 PM5/17/06
to Google-We...@googlegroups.com
Some of the more advanced GWT RPC magic requires a Java server, but
you can definitely do RPCs with non-Java (PHP, ASP, Python, etc)
servers. We included the JSON RPC example in the distribution to
demonstrate this exact use case:

http://code.google.com/webtoolkit/documentation/examples/jsonrpc/

Bret Taylor
Product Manager, GWT

xiayang

unread,
May 19, 2006, 12:30:39 PM5/19/06
to Google Web Toolkit
But must I use JSON format to exchange message between the GWT RPC
client and a non-Java Server? Can I just directly use the xml passed
back from server? Forgive me if I am wrong, I am quite new to AJAX.
Thanks.

Azzah

unread,
May 20, 2006, 6:09:27 AM5/20/06
to Google Web Toolkit
If your server side page output XML and you have an XML parser, then of
course you can use it.

If you have a look at the JSON example (in JSON.java), you'll see the
following in the doFetchURL method:

if (!HTTPRequest
.asyncGet(DEFAULT_SEARCH_URL, new JSONResponseTextHandler())) {

Simply replace DEFAULT_SEARCH_URL with the URL of your server side
process and replace the JSONResponseTextHandler with your own
XMLParsing object.

If you have the choice, I'd really recommend using JSON over XML
though. They are virtually equivalent, but JSON is very lightweight in
comparison to XML. Also, since you're writing code that is eventually
going to be JavaScript, (depending on how Google implements the
Java->JavaScript conversion for deployment) JSON doesn't require any
parsing objects once deployed on your website.

If you're interested, see http://json.org/ for the spec and also
libraries to automatically convert your server side objects into JSON
format.

I'm hoping to use this on my site by the end of the weekend...

Regards,
Aaron Watkins
----------------------
My site: http://www.goannatravel.com

Azzah

unread,
May 21, 2006, 10:29:14 AM5/21/06
to Google Web Toolkit
If you wanted an example of what JSON looks like, hit the following
URL:

http://www.goannatravel.com/test/goanna/get_journal.php
or
http://www.goannatravel.com/test/goanna/get_journal.php?j=1

These URLs may not be around for too long. I've just got GWT working
with my site (see http://www.goannatravel.com/test/goanna), and when
I've finished integrating it, they will all move to a live area (just
replace 'test' with 'home').

Cheers,
Aaron

Message has been deleted

Azzah

unread,
May 23, 2006, 8:01:06 AM5/23/06
to Google Web Toolkit
Fortunately, it's not that difficult.

If you go to http://json.org, down the bottom there's a bunch of links
to JSON in different languages. Download the PHP one. Then in PHP, you
just do something like:


require(<JSON_LIBRARY>);
$JSON = new JSON();
$JSON->encode(<YOUR_PHP_OBJECT>);

Cheers,
Aaron

Reply all
Reply to author
Forward
0 new messages