• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Communication to server--RPC or HTTP Client classes?

 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to incorporate a GWT front-end into a Spring application. This Spring application will have several different kinds of views. GWT will be only one of them.

Given this requirement, it would be nice to decouple the GWT from the server-side code. The GWT Http Request Classes in com.google.gwt.http.client look like an attractive alternative to RPC.

I am a GWT newbie. Perhaps I am not understanding what RPC does. But I ask, for the sake of drawing out the issue,

Why would one ever want to use GWT RPC? Why would not one want always want to use the Http Client classes, in order to decouple server-side code from client-code, with plain Java controller code on the server not wedded to GWT specifics?

or, if the RPC code is necessary, what would be the best way to encapsulate it in this multiple view-style Spring application? Put it into a "GWTController"?


Any suggestions or comments are welcome!

Thanks in advance.




 
Benjamin Weaver
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...or, continuing my second question, if RCP is necessary, why not redirect from Spring Dispatcher Servlet--not to a Controller, but to another servlet, a GWTServlet?

 
Greenhorn
Posts: 20
Google Web Toolkit Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

What it means to implement GWT RPC?

Write a servlet on server side. Everything works like a magic. This is what a GWT RPC gives you. All your client UI code does is get java objects from the GWT Servlet and work with java objects. You wouldn't need to handle HTTP requests, parsing the data or json format or anything else. Your client code remains a pure java code working with java objects alone.

GWT Servlet takes care of translating java objects which are transported to client side, as http requests automatically. So, you need not bother.

Now then, to plugin into spring; yes it is like as you mentioned. For certain views(url patterns), redirect the requests in spring to gwt guy. If you look at how to implement your gwt servlet for RPC, you will know that, the servlet is configured to serve a paritular url pattern.

Good luck!
 
Benjamin Weaver
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Prabakar, you remind me of the benefits of using a servlet. As you say a servlet allows you to work with Java objects and I don't have to worry about httpRequests, formatting, Jason, etc.

And thanks for the confirmation about how to use GWT in Spring. I will approach the problem with more confidence.
 
The moustache of a titan! The ad of a flea:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic