Java Thick Clients
 

Many Web-based systems rely on conventional HTML pages and/or Forms to provide user interaction.  That is, the user interacts with the system by inputting data to an HTML form, pressing a button, and receiving results or confirmation in the form of another Web page and/or form.  Whereas Web pages can support some processing on the client side -- e.g., through JavaScript -- most form-based application processing is normally done on the server side.

Some applications, however, may be more efficient or may require more substantial processing on the client side.  Reasons vary, including not wishing to transmit large quantities of data from client to server, not wanting to transmit especially sensitive data, not wanting to transmit large quantities of results -- e.g., graphic representations -- back from server to client, etc.

Such needs have resulted in the notion of a thick client, implemented in a conventional programming language such as Java, in contrast to a thin client, implemented as a small, easily transmitted Web page.

In the J2EE world, there are two basic approaches to delivering Java-based thick clients.  The most common approach, and the one we will explore, is using the Java Applet framework.  The other approach is based on delivering a stand-alone Java application to a client workstation; the user then invokes the conventional Java application which can open a socket connection with a server to support client/server interaction.  This latter approach has been facilitated by a application distribution system, called Java Web Start, that enables automatic downloading of Java applications to remote client computers.

This lesson will discuss details of building a Java Swing Applet thick client.  It will assume that this component exists within the context of a set of Struts JSP pages that support registration, login, and similar functions that can be handled with conventional HTML forms.  Thus, a thick client applet will be referenced upon successful login. After that, interaction between client and server will involve a server side Java Servlet with the applet communicating with the servlet through a URLConnection.  Finally, logout will be handled in two steps:  first, the servlet will terminate the session, and, second, the applet context will branch to an appropriate logout page.

The lesson will be developed with respect to a list of technical issues that must be addressed to support this architecture and design.


Development Environment

 


Applet Tag

 


Build User Interface
 


Handling User Actions in the Applet

 


URLConnection
 


Servlet to Handle Applet Interaction

 


Deployment