Populating the the GWT form in Java object

17 views
Skip to first unread message

Yakub Baig

unread,
Dec 4, 2008, 3:08:36 PM12/4/08
to Google Web Toolkit
Hi,

I have User registration form in GWT. Now in the controller how do i
get the values which i have entered in the form.
Is there any mechanism like Action Forms of struts in GWT ?
meaning, i want to know that how to get the Action Forms concept (in
Struts) using GWT.

Sumit Chandel

unread,
Dec 8, 2008, 8:14:35 PM12/8/08
to Google-We...@googlegroups.com
Hi Yakub,

It's difficult to map a framework like Struts to full Ajax application development because of the major differences between the location where the control flow logic is run (server versus client). In full Ajax applications, the control flow logic happens on the client through JavaScript manipulating the DOM to render the next screen / interface based on the user's action. In the case of Struts, the logic to determine the next action to perform is processed on the server-side, which breaks the Ajax-style architecture previously described.

If you're building a new GWT application from scratch, I would suggest instead using GWT RPC and designing your own MVC style architecture that flows better with both the Ajax model and your application domain. Using GWT RPC, you can use standard POJOs on both the client and the server and send transfer them over the wire. There are some restrictions on the types that can be serialized across the wire, since not all types that exist in Java have an equivalent in JavaScript, but the RPC system was designed to be sufficiently permitting.

You can check out the detalis on GWT RPC and serializable types at the link below:
http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=DevGuideRemoteProcedureCalls

If you want to instead include a GWT component into an existing Struts application, you can also do this using the RootPanel.get("gwtComponentId").add(myComponent) mechanism, where you would add your GWT component to some element defined on the page, say a div:

<div id="myGwtComponent"></div>

Hope that helps,
-Sumit Chandel
Reply all
Reply to author
Forward
0 new messages