admin管理员组文章数量:1406461
Can GWT be used just for simple AJAX? I dont want the widgets, I just want to avoid coding javascipt. What I need is simple ajax, like clicking on a link and updating the contents of a div with data retrieved from the server, or things like that. Can GWT be used for that purpouse? if so, where can I get some help? All I find on the web is based around the widgets.
Can GWT be used just for simple AJAX? I dont want the widgets, I just want to avoid coding javascipt. What I need is simple ajax, like clicking on a link and updating the contents of a div with data retrieved from the server, or things like that. Can GWT be used for that purpouse? if so, where can I get some help? All I find on the web is based around the widgets.
Share Improve this question edited Jun 15, 2009 at 18:01 Damian asked Jun 15, 2009 at 17:48 DamianDamian 5,57111 gold badges58 silver badges91 bronze badges3 Answers
Reset to default 6Yes indeed that is perfectly possible. The Widgets are only part of the story. You can use the RPC or RequestBuilder to handle server calls using RPC or JSON or XML. You can also use the DOM class and Element classes to manipulate the div blocks directly.
You gain the productivity tools of Java (Eclipse) and you also get the benefit of optimized Javascript code that should work on all supported browsers.
As for documentation you can find all you need in the javadocs: http://google-web-toolkit.googlecode./svn/javadoc/1.6/index.html?overview-summary.html
The relevant packages are:
.google.gwt.dom.client (Document is what you need for DOM manipulations)
.google.gwt.http.client if you want to send GETs/POSTs.
.google.gwt.user.client which contains the Window class
.google.gwt.json.client for sending/receiving json payloads to/from the server
.google.gwt.xml.client in case you want to send/receive XML data and parse it on the client side.
David
Definitely you can use GWT for just making a simple AJAX call. I mean that's what GWT is all about. Detailed information you get here: code.google./intl/en-EN/webtoolkit/doc/1.6/DevGuideServerCommunication.html
So basically you either Use the GWT-RPC mechanism or municate with a server side service which might be plain XML, SOAP or REST based. Of cause you simple can load plain text as well...
In my opinion, if you want to do just an AJAX call and update a HTML element with the data you got from the response, it might be easier (less overhead) to use e.g. the Prototype JS library: http://www.prototypejs/api/ajax/updater
if you like jquery (but dont want to use javascript), there is a library for GWT that replicates that functionality called GWT Query, http://code.google./p/gwtquery/ .
Using that, you can update dom relatively easily, and yet still have the type safe checking of java, as well as the nice features of code obfuscation+minification for free.
本文标签: javascriptSimple AJAX with GWT I don39t need widgetsStack Overflow
版权声明:本文标题:javascript - Simple AJAX with GWT... I don't need widgets - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745007986a2637377.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论