It is a modified version of the basic sample that is created when you use the
applicationCreatorcommand.
applicationCreator com.lodgon.ajax.rpchello.client.HelloThis step creates the default directories and files.
projectCreator -ant rpchelloThis ant-file is used to compile the server-classes.
package com.lodgon.ajax.rpchello.client;
import com.google.gwt.user.client.rpc.RemoteService;
public interface HelloService extends RemoteService {
public String getHello (String question);
}
package com.lodgon.ajax.rpchello.client;
import com.google.gwt.user.client.rpc.AsyncCallback;
public interface HelloServiceAsync {
public void getHello (String s, AsyncCallback callback);
}
package com.lodgon.ajax.rpchello.server;
import com.google.gwt.user.server.rpc.*;
public class HelloServiceImpl extends RemoteServiceServlet implements com.lodgon.ajax.rpchello.client.HelloService {
public String getHello (String question) {
return (question + question.toUpperCase());
}
}
The code generated by the gwt-compiler will use an RPC mechanism to call the getHello method on the server. Therefore, the code in com.lodgon.ajax.rpchello.server.HelloServiceImpl is exectured on the server, and may refer to your own backend classes. The code in com.lodgon.ajax.rpchello.client package is translated into Javascript, hence only the supported types can be used here.
Comments? I would love to get feedback: johan at lodgon.com