GWT:无法找到 RequestContext 方法
我
public interface MyRequestFactory extends RequestFactory {
@Service(Client.class)
public interface ClientRequest extends RequestContext {
Request<List<ClientProxy>> getClients();
Request<ClientProxy> findClient(int id);
InstanceRequest<ClientProxy, Void> persist();
InstanceRequest<ClientProxy, Void> remove();
}
}
正在调用该方法,但
MyRequestFactory.ClientRequest request = requests.clientRequest();
Request<ClientProxy> getReq = request.findClient(clientId);
getReq.fire(
new Receiver<ClientProxy>() {
@Override
public void onSuccess(ClientProxy response) {
display.getBreadCrumpTextBox().setText( response.getBreadcrump() );
display.getIntroductionTextArea().setText( response.getIntroduction() );
}
@Override
public void onFailure(ServerFailure error) {
Window.alert( error.getMessage() );
}
}
);
出现
服务器错误:无法找到 RequestContext 方法 de.xyzMyRequestFactory$ClientRequest::findClient
出了什么问题?
I have
public interface MyRequestFactory extends RequestFactory {
@Service(Client.class)
public interface ClientRequest extends RequestContext {
Request<List<ClientProxy>> getClients();
Request<ClientProxy> findClient(int id);
InstanceRequest<ClientProxy, Void> persist();
InstanceRequest<ClientProxy, Void> remove();
}
}
I am calling the method with
MyRequestFactory.ClientRequest request = requests.clientRequest();
Request<ClientProxy> getReq = request.findClient(clientId);
getReq.fire(
new Receiver<ClientProxy>() {
@Override
public void onSuccess(ClientProxy response) {
display.getBreadCrumpTextBox().setText( response.getBreadcrump() );
display.getIntroductionTextArea().setText( response.getIntroduction() );
}
@Override
public void onFailure(ServerFailure error) {
Window.alert( error.getMessage() );
}
}
);
I am getting
Server Error: Could not locate RequestContext method de.x.y.z.MyRequestFactory$ClientRequest::findClient
What is wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使类 Client Serialized 并添加了一个空构造函数:
现在它可以工作了。
I made the class Client Serializable and added an empty constructor:
Now it is working.