• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

GWT in Action:Qurie about Java Script

 
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do i need JavaScript or Ajax Knowledge to implement Ajax using GWT?
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No...the cool thing about GWT is that if you just know java, it is more than enough. All the javascript is auto generated from the java class that you write. This is what amazes me about GWT!
 
NDP Prasad
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
where do we use the GWT?

In java class or servlet or jsp?
 
author
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

In theory, no you don't need to know any JavaScript at all to create a GWT application.

With regards to AJAX, as long as you grab the concept that the communication between client and server is asynchronous then that should be enough to get creating with GWT.

It is though useful to always keep in mind that the output of GWT compilation, for the client side, is a pure JavaScript representation of you program. This means that your client side code has to play by exactly the same rules as any other JavaScript application - i.e. no database access, no client side file I/O write access, same origin security restrictions etc.

If you need db access then you place this on the server (using either GWT RPC mechanism or any one of your favourite server side languages).

You can of course interact with any JavaScript library you already have using GWT's JavaScript Native Interface (JSNI) which effectively mimics JNI in normal Java to provide access to JavaScript code. If you do so, then a bit more knowledge of JavaScript is necessary.

But, as said at the top, if you don't know JavaScript then that is not a handicap to developing GWT applications.

Hope that helps!

//Adam
 
Adam Tacy
author
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To answer your second post I'll explain a little on what happens with your application if you are going straight to producing code for your web server.

First, you write the code in Java (or at least those aspects of Java currently supported - 1.4 syntax and most of java.lang and java.util - 1.5 syntax is hopefully coming in the next release).

Then you would fire up GWT's compiler, which produces a number of JavaScript permutations of your code. Each permutation covers the various browser nuances and differences.

The compiler also produces a small segment of bootstrap code - it is this code that you load into your web page, which then selects the appropriate JavaScript permutation for the browser (and other conditions if you get more complicated).

So no, there is no Java class or servlet to use for pure client side code it is all stand alone.

If you start implementing server side code, then you are free to use whatever language / technology you want and you just deploy as normal. You can also use an approach called GWT RPC which allows you to write more knitted together code and this does require you to deploy a special servlet to your server to handle the commication/serialization etc but that is a trivial deployment.

//Adam
 
NDP Prasad
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your Elaborate Reply.
 
Maybe he went home and went to bed. And took this tiny ad with him:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic