I have a GWT module with the X-GWT-Module-Base http://host:8080/foo/
and would like to call a (GWT) service which is located at http://host:8080/bar/
. The reason is for example that I want to be able to share a GWT service between two different GWT client projects.
All I've gotten to work so far is if the service is located within the module context, i.e. http://host:8080/foo/bar
works fine, using @RemoteServiceRelativePath("bar")
in my service interface.
It seems that the @RemoteServiceRelativePath
only allows a value relative to the module base URL...so is there some other way to accomplish what I'm trying to accomplish?
Ended up finding the answer myself right here:
the problem appears because of the RemoteServiceRelativePath as you noticed it says relativepath, one way to fix that is to use
((ServiceDefTarget)gwtService).setServiceEntryPoint("/some/absolute/path");
or use the power of the relative path (that's how i do it, because I'm lazy)
@RemoteServiceRelativePath("../servX")
which instead of /modB/servX or /modA/servX will become /servX no matter what module calls it also you'll need to make the proper changes in web.xml so that the
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With