<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
   <struts-config>
	 <form-beans>
	   <form-bean name="userForm" type="com.jspdev.ch17.UserForm"/>
	   <form-bean name="employeeForm" type="com.jspdev.ch17.EmployeeForm"/>
	  <form-bean name="departmentForm" type="com.jspdev.ch17.DepartmentForm"/>	
	  <form-bean name="employeeToDeptForm" type="org.apache.struts.action.DynaActionForm">  
		<form-property name="employId" type="java.lang.String"/>
		<form-property name="deptId" type="java.lang.String"/>		
	  </form-bean> 
    </form-beans>
	 <global-forwards>
	  <forward name="userCreated" path="/viewUser.jsp"/>
	  <forward name="viewEmployee" path="/viewEmployee.jsp"/>
	   <forward name="viewDepartment" path="/viewDepartment.jsp"/>
	   <forward name="error" path="/error.jsp"/>
	 </global-forwards>
	 <action-mappings>
	  <action path="/createUser" 
	         type="com.jspdev.ch17.UserAction"
                 name="userForm" 
                 scope="request"
                 validate="true"
                 input="/createUser.jsp">          
        </action>
         <action path="/createDepartment" 
	         type="com.jspdev.ch17.AddDepartmentAction"
                 name="departmentForm" 
                 scope="request"
                 validate="true"
                 input="/createDepartment.jsp">  
                  <forward
                    name="success"
                    path="/employee/departmentCreated.jsp"/>          
        </action>
        <action path="/createEmployee" 
	         type="com.jspdev.ch17.AddEmployeeAction"
                 name="employeeForm" 
                 scope="request"
                 validate="true"
                 input="/createEmployee.jsp"> 
                  <forward
                    name="success"
                    path="/employee/employeeCreated.jsp"/>       
        </action>
        <action path="/addEmployeeToDept"   
                name="employeeToDeptForm"             
                type="com.jspdev.ch17.AddEmployeeToDeptAction"	          
                scope="request"
                 input="/addEmployeeToDept.jsp">  
                  <forward
                    name="success"
                    path="/employee/addEmployeeToDept.jsp"/>          
        </action>
        <action path="/deleteEmployeeFromDept"   
                name="employeeToDeptForm"             
                type="com.jspdev.ch17.DeleteEmployeeFromDeptAction"	          
                scope="request"
                 input="/deleteEmployeeFromDept.jsp">  
                  <forward
                    name="success"
                    path="/employee/deleteEmployeeFromDept.jsp"/>          
        </action>
      </action-mappings>
 <message-resources parameter="ApplicationResources"/>  
  </struts-config>
