views:

69

answers:

2

I have an app written with GWT and GAE where every supported city has its own app. Clearly this is not the best way to manage the map so I want to merge them all into one app. Currently my app is at the urls sub1.myapp.com, sub2.myapp.com, sub3.myapp.com, etc, and I want them to be at myapp.com/sub1 ,myapp.com/sub2, etc. All the supported cities share common code, so I'm going to put all the that code in one module, and have a different module for each piece of unique code block. Is this going about it the right way? How will the different modules interact?

Also, I currently have JSPs at sub1.myapp.com/listofsomesort and I would like to move these to myapp.com/sub1/listofsomesort. Is there a simple way to accomplish this?

A: 

This seems like the job for Code Splitting :) It might require some changes in the structure of your code, though - depends how tightly coupled your classes are. A compile report should tell you if your code splits up nicely, or if not, where the connections are.

Igor Klimer
I'm going to look into this further when I get a chance, but I don't think its right for me because the majority of the code that I need to change is on the server-side. What I'm looking for is a better understanding of how to transform my code so that what were previously two entry points in two completely different apps accessed at sub1.myapp.com and sub2.myapp.com, can now be accessed with individual entry points on the same app at myapp.com/sub1 and myapp.com/sub2. The RPCs are almost same for both sub1 and sub2. The only differences are that the query data from different cities.
culov
+3  A: 

By making a module with EntryPoint for each old application, in one and the same application. Each module has one 'welcome page' which you can put in different directories. All the shared code can go into another module. The shared code can be used by the inherit setting in other modules.

The only thing I bumped into was that when you deploy to GAE, ALL modules should have an entry point, also the library modules. I solved it by adding a dummy EntryPoint to them, that does nothing, but still searching for a better solution. See my question at http://stackoverflow.com/questions/3897746/how-to-deploy-gwt-project-containing-gwt-modules-without-entry-points-with-eclips.

Michiel Borkent
i havent yet had a chance to get started, but this is exactly the type of advice i needed. thanks.
culov
I have a couple specific questions: Did you modify web.xml? If the welcome file is set to MyApp.html, is it then possible to just copy that file into a directory /nyc and save it as index.html, expecting the app to work if i change the nocache path?
culov
I didn't change web.xml. The project in which I did something similar just has all the welcome files in the war folder and one of them is the 'welcome page' that gets loaded by default. The other pages are reachable by links from there. You can load a GWT-module from ANY html file, so I'm sure you must be able to work it out in your situation. Also see: http://code.google.com/intl/nl-NL/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideHostPage
Michiel Borkent