3

Is it possible to host a GWT-compiled web application in NodeJS?

I like NodeJS however there are lots of work already made with GWT for my projects.

Cheers.

quarks
  • 33,478
  • 73
  • 290
  • 513

2 Answers2

2

Yes. GWT is a client-side technology and does not need to interact with your server at all. It is possible to send arbitrary requests to any server and process the feedback.

You won't be able to use GWT-RPC or RequestFactory.

Riley Lark
  • 20,660
  • 15
  • 80
  • 128
2

On the client side, as @riley-lark said.

You can also use GWT code on the server-side on NodeJS; see https://github.com/cretz/gwt-node and http://code.google.com/p/gwt-exporter/

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164
  • Though if you are writing Java for the sake of compiling to Javascript on both client _and_ server, some might call you silly. – Colin Alworth Nov 14 '11 at 23:20
  • @Thomas Broyer, what is gwt-node? Does it generate javascript source for NodeJS? – quarks Nov 15 '11 at 01:51
  • @ColinAlworth: couldn't it be useful to share some GWT code between client and server? not coding everything server-side in Java/GWT, but allow reusing some GWT code on the server-side (hence pointing to gwt-exporter). – Thomas Broyer Nov 15 '11 at 09:52
  • @xybrek AIUI, yes, gwt-node aims at generating "server-side NodeJS code" from GWT/Java code. I stumbled upon it a few days back; I don't know how it works, if it works, what are the use cases, etc. only that it exists. – Thomas Broyer Nov 15 '11 at 09:54
  • @ThomasBroyer: you're right of course, that would be some use case - my comment was more to point out that there are perfectly acceptable java servers out there, and if javascript is the end goal for both, something like the closure compiler might make the work easier. And perhaps to sound clever, but that never works as well as I plan. – Colin Alworth Nov 16 '11 at 16:19