Я только что написал простой вызов RPC, когда я попытался получить следующую ошибку, не могли бы вы помочь мне исправить это ..
[WARN] 404 - POST /com.sribalajiele.gwt.client.SriBalajiEle/emailRpcService (127.0.0.1)
Email Failure404
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 404 NOT_FOUND</title>
Код, как показано ниже.
/*
* Copyright (c) Balaji electricals AG 2011, All Rights Reserved
*/
package com.sribalajiele.gwt.client.client;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
/**
* @author kdel.
* This interface provides Email Service.
*
*/
@RemoteServiceRelativePath("emailRpcService")
public interface EmailRpcService extends RemoteService {
public WriteToUsForm sendEmail(WriteToUsForm writeToUsForm) throws IllegalArgumentException;
}
/*
* Copyright (c) Balaji electricals 2011, All Rights Reserved
*/
package com.sribalajiele.gwt.client.client;
import com.google.gwt.user.client.rpc.AsyncCallback;
/**
* @author kdel
* Async service for Email.
*/
public interface EmailRpcServiceAsync {
void sendEmail(WriteToUsForm writeToUsForm, AsyncCallback<WriteToUsForm> asyncCallback)
throws IllegalArgumentException;
}
public final class EmailRpcServiceImpl extends RemoteServiceServlet implements EmailRpcService {
/**
* Default serialVersionUID.
*/
private static final long serialVersionUID = 1L;
@Override
public WriteToUsForm sendEmail(WriteToUsForm writeToUsForm) throws IllegalArgumentException {
System.out.println("send Email called");
}
}
В web.xml
:
<servlet>
<servlet-name>emailService</servlet-name>
<servlet-class>com.sribalajiele.gwt.client.server.EmailRpcServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>emailService</servlet-name>
<url-pattern>sriBalajiEle/emailRpcService</url-pattern>
</servlet-mapping>