How To Upgrade To GWT 1.6
So I am upgrading our application framework to GWT 1.6 (from 1.5). The next several posts will be about the little things I learned and don’t want to forget. The initial upgrade process was pretty painless. The source itself went relatively smoothly. The build process was another issue. The most challenging portion was the RPC calls.
With 1.6, the packaging structure moved to a war hierarchy. The war directories are used by hosted mode. The modules are compiled into a subdirectory of the war based on the module “rename-to” attribute. This attribute becomes part of the GWT.getModuleBaseURL() which is what we use to prepend all of our service calls:
private LoginServiceProxy() { proxy = (RoutingServiceAsync)GWT.create(LoginService.class); ServiceDefTarget endpoint = (ServiceDefTarget)proxy; endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "login"); }
The getModuleBaseURL() now includes the “rename-to” parameter. This was causing some grief until I remembered that. I now need to build the endpoint URL without the module name. This will allow me to remove the apache rewrites and/or allow for the applications to run in both hosted and webmode. Don’t ask, I did some creative stuff to get our RPC calls to work until I remembered this code.