gwt+spring run in host mode is fine. but when i deployed war in tomcat ,rpc call is wrong.
web.xml
PHP Code:
<servlet>
<servlet-name>gwt-controller</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>gwt-controller</servlet-name>
<url-pattern>*.gwt.rpc</url-pattern>
</servlet-mapping>
gwt-controller-servlet.xml
PHP Code:
<bean id="handlerMapping"
class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" />
<bean name="/testgwt5/greet.gwt.rpc"
id="greetService"
class="com.zeng.server.GreetingServiceImpl">
</bean>
GreetingService.java
PHP Code:
@RemoteServiceRelativePath("greet.gwt.rpc")
public interface GreetingService extends RemoteService {
String greetServer() throws IllegalArgumentException;
}
TestGWT5.java
PHP Code:
greetingService.greetServer(
new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
// Show the RPC error message to the user
dialogBox
.setText("Remote Procedure Call - Failure");
serverResponseLabel
.addStyleName("serverResponseLabelError");
serverResponseLabel.setHTML(SERVER_ERROR);
dialogBox.center();
closeButton.setFocus(true);
}
public void onSuccess(String result) {
dialogBox.setText("Remote Procedure Call");
serverResponseLabel
.removeStyleName("serverResponseLabelError");
serverResponseLabel.setHTML(result);
dialogBox.center();
closeButton.setFocus(true);
}
});
when i deploy on tomcat ,always run to onFailure(Throwable caught){}
Please help me. thanks a lot.