title: Is it possible to programmatically change GWT RPC servlet path?
body: <p>My GWT app works fine when run from <a href="http://localhost:8080/myapp" rel="nofollow">http://localhost:8080/myapp</a>. </p>
  
  <p>I need to host the gwt app behind what is essentially a proxy. When behind the proxy, the url changes to something like <a href="http://localhost:8080/foo/bar/00_00_00/myapp" rel="nofollow">http://localhost:8080/foo/bar/00_00_00/myapp</a>. </p>
  
  <p>Gwt is throwing an error when I try to access behind the proxy: </p>
  
  <blockquote>
    <p>myAppServlet: ERROR: The module path
    requested,
    /foo/bar/00_00_00/myapp/MyApp/, is not
    in the same web application as this
    servlet, /myapp.  Your module may not
    be properly configured or your client
    and server code maybe out of date.</p>
  </blockquote>
  
  <p>The error appears to occur after rpc request when gwt tries to serialize java objects and send them back to client. </p>
  
  <p>Is there any way to inform GWT that the app is behind a proxy?</p>
  
  <p>Update: </p>
  
  <p>It seems to work fine the first request. But then it fails for all other requests??!!
  I found the error is coming from RemoteServiceServlet.loadSerializationPolicy. Unfortunately, I can't override since it's static.</p>
  
  <p>Maybe it's possible to set the servlet context path programmatically?</p>