What the code is ?
• Client-side code
– uses CSS for formatting
• Server-side code can be implemented
– including Java 5 and 6
– commonly Java-based GWT RPC servlets are used
For now Let us implement a basic application say “My Total Bill App ” for your understanding using GWT Remote Procedure Call (GWT-RPC) . The whole thing what we have to do is to implement following:
- Implementing the synchronous & asynchronous interfaces
- Building user interface using GWT
- Writing a service implementation
The basic GWT project structure looks like as:
1. Building user interface with GWT in MyTotalBill.java(Client Side)
After implementing this with corresponding HTML page you will find the user interface as follows:
Each RPC service must define a pair of interfaces: the synchronous interface, which is implemented on the server, and the asynchronous interface, which is called by the client-side code.
3. Writing the Service implementation BillServiceImpl.java(Server Side) :-
4. Adding the onclick handler on submit button in MyTotalBill.java.
5.Configuring the web.xml file to define servlet mapping:
6. Now we are ready to run our application, the result will look like as:
You can find My Total Bill app on GitHub.