3

I am planning on building a GWT app that will be deployed to GAE. In addition to the normal (GWT) web client, the server-side code will service requests from other clients besides just the web app. Specifically, it will host a RESTful API that can be hit from any HTTP-compliant client, and it will also service requests from native apps on iOS and Android.

If my understanding of GWT is correct, it's your job to code up both the client-side code (which includes the AJAX requests your app makes back to the server) as well as the server-side request handlers.

This got me thinking: why do I need to package the web client and the web server inside the same WAR? This forces me to (essentially) re-deploy the client-side code every time I want to make a change to the backend. Probably not a big deal, but if I don't have to, I'd prefer to honor "separation of concerns".

So I ask: is there a way to essentially deploy a Java-less WAR on GAE in such a way that it just serves pure HTML/JS/CSS back to any clients that will use it, and to then deploy the server-side in its own WAR, and some how link the two up? Thanks in advance!

Bantha Fodder
  • 1,242
  • 1
  • 11
  • 19

3 Answers3

1

The WAR is just for the server side. It includes the client-side classes needed for serializing objects passed between client and server: obviously, both sides need implementations of the same objects in order to handle those objects.

I don't think it will save you any effort or development time to separate the two concerns, but if you really want to, then you can rework your client/server interaction using something other than GWT-RPC. For example, JSON. See https://developers.google.com/web-toolkit/doc/latest/DevGuideServerCommunication#DevGuideHttpRequests for discussion of your options if you want to go down that road.

aecolley
  • 1,973
  • 11
  • 10
  • Thanks @aecolley (+1) - quick follow up: I'm interested in taking advantage of the new(er) `RequestFactory` which (as I understand it) is not built on top of the "older" GWT-RPC model. How does RequestFactory relate to the links that you posted - are they one in the same or do they serve different purposes (and if so, how are they different)? Thanks again! – Bantha Fodder Oct 21 '12 at 00:11
  • RequestFactory vs GWT-RPC proper is discussed in . In the context of this question, RequestFactory can reduce the amount of client code which is dragged into your deployed server (and vice versa). – aecolley Oct 21 '12 at 01:18
  • Thanks again @aecolley: that is a great question you referenced above, however it concerns making the decision of when to use GWT-RPC and when to use RequestFactory. I have already made up my mind to use RequestFactory, so what I'm curious about is whether or not this "rework" that you mentioned in the last paragraph of your answer (i.e JSON, etc.) is the stuff that makes up RequestFactory, or if its totally different than RequestFactory. If its the internal guts of RequestFactory, then I'm all set. If it's different than RequestFactory, I'm curious as to how its different. Thanks again! – Bantha Fodder Oct 21 '12 at 01:57
  • No, I meant you'd have to rewrite your app's client/server communication in terms of (HTTP) `RequestBuilder`. It's more work, but it means you can change the server implementation to something other than Java. – aecolley Oct 21 '12 at 02:17
0

No, AFAIK, you can not do partial update in GAE, i.e. you can not upload a part of the project to GAE instance and then upload in a separate upload another part (and so separating HTNML/JS/CSS to java classes).

Peter Knego
  • 79,991
  • 11
  • 123
  • 154
-1

Hopefully this is what you are looking for.

Finally the main stub that you want to deploy might be EAR file which you can mention in main pom.xml

itzmebibin
  • 9,199
  • 8
  • 48
  • 62
BeingSuman
  • 3,015
  • 7
  • 30
  • 48