I know you can get the GWT module name client side using GWT.getModuleName() or getHostPageBaseURL(), but is it possible to access it from the server?
What I’m after is the base URL of the deployed application. For example, if the GWT app is deployed as http://foo.com/deploy1/MyModule/ what I want to know is that the request came from the base URL of http://foo.com/deploy1/
Simply getting the URI from the HTTP request will give me the full module path, when I really want the base (it will be deployed under different sub-paths at the same domain)
getContextPath()will give you the/deploy1path.If you need the full URL, you can easily reconstruct it from the other
HttpServletRequestproperties, or you can start withgetRequestURLand tweak the result to replace the path part.