Checklist:
Struts-Based User Interface

Strategy

The strategy is based on using the Struts architecture and tools to build a Model - View - Controller user interface.

Most of the work is done through the Web Diagram view and various wizards and panels. Java code must also be inserted at key points in the generated components.

Steps:

  1. Create an empty J2EE project
    1. Include EJB Project option on wizard

  2. Create a Web Project within the J2EE project
    1. Select the Add Struts support option
    2. Select appropriate tag libraries; e.g., JSP standard and utility libraries

  3. Create a Web Diagram to help in creating and connecting components
    1. Select New > Other > Web > Struts > Web Diagram

  4. Create Form Beans for each Form, JSP page, or logical set of user input data.
    1. Right-click > New > Form Bean Node.
    2. Place newly created from bean on the Web Diagram (left click).
    3. Open newly-created Form Bean (double-click) for editing.
    4. Specify Java class name for the bean.
    5. Select and/or create properties to be added to the bean.
    6. Indicate appropriate getter/setter methods to be created.
    7. Specify mapping name.

  5. Create the various JSP pages for the user interface.
    1. Right-click > New > Web Page Node.
    2. Place the Web Page icon on page and (carefully) name it

  6. Create Action Mapping Nodes to be called for each Form, JSP page, or logical set of user operations.
    1. Right-click > New > Action Mapping Node.
    2. Place newly created Action on the Web Diagram and name it.

  7. Connect the Web Page Nodes (JSP page) to their appropriate Action Mapping Nodes.
    1. Right-click start Node/JSP > select Connection > drag to appropriate Action Node > select it.
    2. Right click on an Action > select Connection > drag to appropriate JSP
    3. Name the Action to JSP links > specify name (e.g., successfailure, etc.)

  8. Generate initial/default code for Web Page Nodes (JSPs).
    1. Double-click Web Page Node.
    2. Identify the Form Bean the page will use.
    3. Select the fields to be included on the form
    4. Reorder fields, as necessary.
    5. Edit the JSP/HTML for desired appearance.

  9. Generate initial/default code for Actions.
    1. Double-click Action.
    2. Identify the package and class name for the action.
    3. Verify the generated scope and Form Bean
    4. Verify the mappings -- e.g., success and failure mappings

  10. Build the Model
    1. Build the Java class that will be called by the Actions to implement the semantic or business function supported by the user interface.

  11. Run on Server
    1. Server perspective > New > Server and Server Configuration.
    2. Select Test Environment
    3. Name the Server.
    4. Select a start page (e.g., login.JSP) > right-click > select Run on Server > select appropriate server.

  12. Resources
    1. Apache Jakarta Struts Project, http://jakarta.apache.org/struts/.
    2. Struts API.
    3. WebSphere Help: Application developer information > Struts application development.
    4. Colin Yu and Jane Fung, Writing a Simple Struts Application using WebSphere Studio V5.  http://www-106.ibm.com/developerworks/websphere/techjournal/0302_fung/fung.html
    5. JSPOlympus Struts Site, http://www.jspolympus.com/Struts/Struts.jsp (Not WebSphre specific).