Now we can start implementing the client.
GWT has created a html file AdminApp.html. Let's clean it up a little:
...
<body>
<h1>PHPBB Admin</h1>
<p>
Administration of users.
</p>
<p id="slot1"></p>
</body>Create a separate class to hold the login widgets:
Show that panel in the main module:
public class AdminApp implements EntryPoint {
/**
* This is the entry point method.
*/
public void onModuleLoad() {
LoginPanel loginPanel = new LoginPanel();
RootPanel.get("slot1").add(loginPanel);
}
}And run:

Now, we need to connect the client to the server. To do this, we will use GWT RPC.
Create 2 similar interfaces in the com.objectgen.phpbb.client package:
public interface LoginService extends RemoteService {
UserDTO login(String username, String password);
}
public interface LoginServiceAsync {
void login(String username, String password, AsyncCallback callback);
}
Then, create an implementation of LoginService in package com.objectgen.phpbb.server.
Note how I use Dozer to convert the User object to a UserDTO.
The reason is that JPA classes cannot be serialized by GWT,
so HiberObjects generates DTO objects that can be used for this purpose.
(You can download Dozer from the Download page.)
Register the servlet in AdminApp.gwt.xml:
<servlet path="/login" class="com.objectgen.phpbb.server.LoginServiceImpl"/>And create an instance of the servlet in our main module:
Now, LoginPanel will get a reference to the servlet that it can call:
Next: UI Behavior