jwma Development - Servlet based Controllers
 
Main | Deployment | Configuration | Architecture | Development | Screenshots | SF Project Site
Index | Overview | Building | API Docs | Credits & Contributors

General Remarks


jwma is distributed with a standard implementation of the controller element (see Architecture/Controllers), which is based on plain servlets (i.e. specialised HttpServlet implementations). The aim of this document is to describe these servlet based controllers with more detail: starting from general and common information, followed by links to specifications of each controller implementation.

Basic Mode of Operation

All of jwma's servlet based controllers share a common structure and mode of operation, which directly implements the abstract controller element tasks stated in the architecture documentation:
  1. Maintain session
  2. Handle and verify input data (e.g. request parameters)
  3. Manipulate or instantiate model objects according to request
  4. Store or update model instance references (in the maintained session)
  5. Redirect to an appropriate view
These tasks have been translated to a common basic process flow of each of the controller implementation, which is depicted in Figure 1.

Figure 1: Servlet Based Controller Flow

The actual "control" of the model happens in so called actions, which are methods of the respective controller in jwma's case.
The controller first retrieves the request parameters which specify an action: For each target, there exists a dispatching method, which will retrieve the mandatory action parameters and dispatch to the actual action method. These methods follow a compositional naming convention:
do<Task><Target>() (e.g. doDisplayMessage()).


The Implementations

For each of the architecture's abstract controllers exists one servlet and a related specification. The specification consists of a list of targets and describes actions in terms of their functionality, parameters and the view they redirect to. The following list presents the mapping of the implementations to the abstract counterparts, as well as links to the respective specification:
  1. Main: JwmaController
  2. Mailing: JwmaSendMail
  3. Contacts: JwmaContactsController
  4. Admin: (non existant, but planned)
There is also an annotated UML class diagram (unfortunately a bit outdated, respectively incomplete) documenting the standard implementation of the controller element.

© 2000-2003 jwma team