English 中文(简体)
GWT RPC or Request Builder using Javascript Overlay?
原标题:

GWT RPC is a mechanism provided by gwt to communicate between client and server. Also there s a Request Builder, through which you can connect to the server.

Which mechanism would you recommend for a gwt based app, and please state the reasons to do so as well..

最佳回答

I d think GWT RPC is most likely the way to go.

I might be wrong about this, but I believe the gwt RPC solution is built on top of RequestBuilder. It adds functionality on top of RequestBuilder such as automatic serialization of java classes and makes it pretty trivial to send data back and forth. Also, gwt RPC is probably the most popular solution at this time and so you ll find a lot more support in the form of tutorials and blog articles.

I tried "rolling my own" client/server mechanism using RequestBuilder, and it s doable, but in the end, gwt RPC already does everything I needed to implement in my custom solution so I decided to go back to it.

The only reason I could see needing to use RequestBuilder is if you need to do something outside the lines that doesn t work inside gwt RPC. For example, in one application, I needed to communicate using jsonp from my client code to a third party rest api that I didn t have control over. In this case, I wasn t able to use gwt rpc because I didn t have access to the server component.

问题回答

GWT RPC is probably the way to go if your server is running Java.

If your GWT application needs to talk to a .NET, PHP, Python or other server you need to roll your own, using the RequestBuilder class. I would recommend using JSON as a way of representing the data.

Overlay types make parsing the JSON that comes back trivial.

Overlay objects can be serialized back to JSON with the following

   String json = new JSONObject(overlayInstance).toString();




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签