Content
RemoteServiceServlet
^
|extends
SampleServiceImpl (class)
^
|extends
SampleServiceImpl (class)
SampleService
^
|implements
SampleServiceImpl (class)
o On the Server Side, create a class that extends
RemoteServiceServlet and impletments the SampleService interface
o Select the src directory or package
o Right Click and select: New — Class
o For the package name enter: com.sample.server
o Enter for Name: SampleServiceImpl
o Click button: Add
o From the Superclass, enter RemoteServiceImpl
o For Choose interfaces, enter: RemoteServiceServlet
o Click button: Browse
o The com.google.gwt.user.server.RemoteServiceServlet
will be matched.
o Click: Ok
o Select from Interface, click: Add button
o Select interface: SampleService
o Click: Finish
o Here is the code we created in the com.sample.server package:
RemoteServiceServlet and impletments the SampleService interface
o Select the src directory or package
o Right Click and select: New — Class
o For the package name enter: com.sample.server
o Enter for Name: SampleServiceImpl
o Click button: Add
o From the Superclass, enter RemoteServiceImpl
o For Choose interfaces, enter: RemoteServiceServlet
o Click button: Browse
o The com.google.gwt.user.server.RemoteServiceServlet
will be matched.
o Click: Ok
o Select from Interface, click: Add button
o Select interface: SampleService
o Click: Finish
o Here is the code we created in the com.sample.server package:
public class SampleServiceImpl extends RemoteServiceServlet implements
SampleService {
@Override
public String getMessage() throws IllegalArgumentException {
return "message goes here";
}
}
o The service we need will generate the body message:
“message goes here”
o Change the return statement to:
return “message goes here”;
o Yup! we implemented our service
“message goes here”
o Change the return statement to:
return “message goes here”;
o Yup! we implemented our service