Well, we have managed a workaround that lets us keep our existing
web.xml with no modifications (e.g. no module specific servlets).

All our services go through a single point when registered:

        public static void register(final String uriSuffix, final Object
onlineImpl) {
                ServiceDefTarget target = (ServiceDefTarget) onlineImpl;
                String moduleBaseURL = GWT.getHostPageBaseURL();
                String address = moduleBaseURL + uriSuffix;
                target.setServiceEntryPoint(address);
        }

So you would call this like:
ServiceManager.registerOnline(IMyService.URI, GWT.create
(IMyService.class));

Note instead of using GWT.getModuleBaseURL() we are using
GWT.getHostPageBaseURL() as this way we can share all our services
between modules.

The other problem I referred to in my first post was resolved by
correctly referencing module2/module2.nocache.js in the html file
instead of the full names which we had previously.

On Oct 1, 10:34 am, Sripathi Krishnan <[email protected]>
wrote:
> *re. duplicate servlet mappings *
> We keep our services under a /service path which is parallel to /module1
> /module2 etc. And in the RemoteServiceRelativePath annotation, we define the
> path as "../service/MyService". That way, it remains the same for all
> modules.
>
> I am not sure I understood your second problem, so can't comment on it.
>
> --Sri
>
> 2009/9/30 Joe Cole <[email protected]>
>
>
>
>
>
> > In 1.5 we have a structure similar to this:
>
> > src
> > - module1.gwt.xml
> > - module2.gwt.xml
> > - module3.gwt.xml
> > - client
> > -- entry point 1
> > -- entry point 2
> > -- entry point 3
> > - public
> > -- other public resources
> > -- module1.html
> > -- module2.html
> > -- module3.html
>
> > All three modules share a lot of different servlets, which we define
> > in our web.xml
>
> > We have started to move to 1.7.1 and are wondering what is the easiest
> > way to structure multiple modules with the new war format. Our new
> > layout is like this:
>
> > src
> > - module1.gwt.xml
> > - module2.gwt.xml
> > - module3.gwt.xml
> > - client
> > -- entry point 1
> > -- entry point 2
> > -- entry point 3
> > war
> > -other public resources
> > -module1
> > -module2
> > -module3
> > -WEB-INF
> > --web.xml
>
> > This means that we have to duplicate servlet-mappings for the
> > different services in the web.xml
> > - e.g. module1/service1, module2/service1 module3/service1
>
> > Is this the right way to structure a multi-module package that shares
> > servlet's between them? Does anyone have a better way?
>
> > Lastly, when I run our launch file for the module2/module3, I get an
> > error indicating that gwt hasn't renamed our module (e.g.
> > com.company.module2) to the shorter name in the gwt.xml (module2):
>
> > [WARN] 404 - GET /com.company.Module2.nocache.js (127.0.0.1) 1440
> > bytes
>
> > This obviously stops us loading the other modules. Am I missing
> > something?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to