Action interaction in Struts and form submission: view an employee


Let us change the application to view an employee information in a separate form.


To view an employee we will create a separate Action class, EmployeeActionView, which will handle "view" event:


public class EmployeeActionView extends Action {

} }}}

We will change the employee list page so that EmployeeActionView is called when a user clicks on employee ID:

{{{<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="" prefix="html" %>



The employee list is displayed with the simple Action class as in the first Struts sample (see above). The configuration file reflects the relationship of two actions:



<action path = "/employeesListView"


<action path = "/employeeActionView"


This example uses EmployeeForm to temporarily store input/output data.

StrutsQuickStart3 (last edited 2009-09-20 23:12:46 by localhost)