On 14 avr, 12:34, Bezge <[email protected]> wrote:
> I use a servlet in the hosted mode which acts as a proxy since i
> cannot directly communicate with the server due to the same origin
> policy. Once deployed the servlet is no more needed since both would
> run on the same server. So I decided to have a separate module for the
> servlet which is inherited by the module of the main project. But the
> servlet is only deployed by Jetty when I reference the servlet in the
> web.xml of the main project.
[...]
> Is there a way to use server-side code from an inherited module in the
> hosted mode without modifying the web.xml of the main project?
"Just" use a different war directory (and use the -war option of the
HostedMode/Compiler to tell it which one to use) with a different
web.xml. Or you could, for example, have a web.xml.deploy file and use
Ant to replace the web.xml (used for HostedMode) content with the one
from the web.xml.deploy file when packaging your app.
If you're not using Jetty on your deployment server, you could
probably configure your proxy in a WEB-INF/jetty-web.xml (I'm not used
to Jetty and haven't found how to do it yet; looks like it would have
to be a proxy *handler*, not servlet).
> Servlet Project:
> Servlet.gwt.xml:
> <module>
> <servlet class="server.Servlet" path="/servlet" />
> </module>
If you're using GWT 1.6, <servlet/> is deprecated (and un-needed /
useless)
I personally wouldn't use a GWT module for the proxy servlet, just
package it in a JAR (or add a dependency between two Eclipse projects,
or...) and put it in the WEB-INF/lib (if the class is your project,
you have *nothing* to do, it'll be compiled and put in the WEB-INF/
classes when launching the HostedMode, and you "just" have to map it
in your web.xml (or jetty-web.xml?))
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---