Simple question, maybe someone knows:
In GWT devmode, my urls look like this: http://myserver/myapp/myservice
When I run ‘ant war’ and deploy that war on tomcat, they mysteriously change to: http://myserver/myapp/myapp/myservice
Everything still works, but obviously the URLs are uglier. I’d like to just keep the URLs used in devmode. Any info is appreciated, thanks.
-tjw
Ok, I’ve got a solution for this. So many people are having this problem all over the net, I decided to answer my own question. The key is to use
@RemoteServiceRelativePathin yourRemoteServiceinterface file. For example, to solve my original problem, I would annotate myRemoteServiceinterface like this:This way, whatever path is in front of the service’s URL is irrelevant. Now in the
web.xml, instead of using/myapp/myserviceas theurl-pattern, I just use/myservice. Now it works in both GWT’s devmode and in Tomcat with no further modification needed.