English 中文(简体)
Is it possible to create a purely client-side GWT application?
原标题:

I m fairly familiar with GWT - having completed the Eclipse-based tutorial. But the tutorial runs in client-server mode.

My question is: is it possible to create a GWT application that completely runs client-side, where javascript/html is generated but there is no reliance on backend java classes?

I understand that the full breadth of GWT capability may not be present (including the use of Java runtime functionality), but I remain interested in such a solution.

cheers, Ian

最佳回答

GWT application are basically client side application.

For the hosted mode since their is some debugging involve it use java.

When you do a normal (release) compilation GWT would generate the javascript of your application and you don t need the java at server side anymore.

See the documentation there, in web mode the javascript are produced and you don t need the java server side anymore.

问题回答

It s definitely possible to write a GWT app that is downloaded to the client and run, without any further communication with the server. All you d need to do is make the app not include any calls to a server-side API. Any data necessary to the app could be downloaded and stored on the client using Gears.

That being said, the browser would still need to connect to the server to download the app (and any data), but once that s done, you could disconnect the network and continue to function as normal.

I am sorry in advance if I took this question too far or in a wrong direction.

RageZ is right that GWT applications are all client-side. Server-side integration is supported in GWT using GWT-RPC, etc. and you will have to provide at least minimum server support outside of GWT to run it.

Are you trying to implement functionality that commonly runs on a server using client-side GWT only?

If the answer is no then you have no server-side functionality (persistence, services, tasks, etc.) and your GWT should and will be pure client side application.

If the answer is yes then you have a sophisticated exercise that may or may not be possible with a sub-set of Java GWT supports. But architecturally it is very questionable approach since server-side functions are centralized for a reason: shared resources such as persistence, collaboration, scalability, availability, maintenance, other QoS, etc.





相关问题
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.

热门标签