- Code: Select all
package com.mycompany.gwt.client;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
public interface TestRS extends RemoteService {
/**
* Utility class for simplifying access to the instance of async service.
*/
public static class Util {
private static TestRSAsync instance;
public static TestRSAsync getInstance(){
if (instance == null) {
instance = (TestRSAsync) GWT.create(TestRS.class);
ServiceDefTarget target = (ServiceDefTarget) instance;
target.setServiceEntryPoint(GWT.getModuleBaseURL() + "/TestRS");
}
return instance;
}
}
}
I believe there's an issue w/ this line:
- Code: Select all
target.setServiceEntryPoint(GWT.getModuleBaseURL() + "/TestRS");
According to the documentation for GWT.getModuleBaseURL(), the url is guaranteed to end with a slash. So the generated code will create a url that looks like this:
http://server:port/module//TestRS
Now, this works fine on TomCat and JBoss. However, WebSphere complains about the double slash before TestRS. I believe the correct code for GWTDesigner to generate should be this:
- Code: Select all
target.setServiceEntryPoint(GWT.getModuleBaseURL() + "TestRS");
Curious what others think. Am I right about this one?