Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT without JavaScript?

I was looking into GWT. It seems nice, but our software have the must work without JS requirement. Is it possible?

like image 289
Loki Avatar asked Nov 28 '08 19:11

Loki


2 Answers

No, it isn't. GWT provides a windowing toolkit that is specifically designed to run on the client, not on the server. Degraded (e.g. non-javascript) code would need to deliver complete HTML to the browser, which GWT simply does not do. It compiles your java code to a javascript file that is delivered to the client and builds the UI by DOM-manipulation on the client. Then there's some code to talk back to the server, some implicit, some written by you yourself. This model does not lend itself well to degrading gracefully.

The only way to degrade somewhat gracefully is to provide a second, non-javascript UI or use another toolkit that doesn't render the frontend on the client but delivers HTML. Sorry.

like image 85
Olaf Kock Avatar answered Sep 19 '22 06:09

Olaf Kock


You could degrade gracefully by creating an html structure that is just 'good enough' (with form posts, linked menus, etc) and then have GWT attach to each part of that structure, augmenting its behavior. For example, make an HTML drop down dynamic, replace a link to another page with a component that opens a lightbox, or replace a link to another page with an XML http request to do the same thing (e.g. cast a vote).

I've done this a number of times for clients.

It's the opposite way that most GWT gets developed, but it can work.

like image 24
mooreds Avatar answered Sep 21 '22 06:09

mooreds