views:

339

answers:

1

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?

+2  A: 

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

Epaga