This image shows the sequence of events that occurs when you add benefits to an employee.
The client sends a request to the Controller servlet.
The Controller calls the getInstance and createActionHandler methods on the ActionHandlerFactory and calls the performAction method on AddBenefitToEmployee.
If the benefits parameter is equal to null, AddBenefitToEmployee forwards the request to the addBenefitToEmployee JSP and the following things occur:
The JSP calls getEmployeeManager on the SessionHelper and getUnelectedBenefitItems on the EmployeeManager bean.
The EmployeeManager calls the create and getBenefits methods on the BenefitCatalog bean.
The BenefitCatalog bean calls the new method on the BenefitModel.
The application returns the information to the addBenefitToEmployee JSP, which sends a response to the client.
The EmployeeManager also calls getEmployeeDetails and getEmployee. See Figure 6-3, Query Employee Sequence, for more details.
If the benefits parameter is not equal to null, the following things occur:
The AddBenefitToEmployee calls getEmployeeManager on the SessionHelper, getEmployee on the EmployeeManager, and addBenefits on the Employee entity bean.
EmployeeManager calls getEmployeeDetails and getEmployee.
The Employee entity bean calls addBenefits on EmployeeDAOImpl. If successful, AddBenefitToEmployee forwards the request to the success.jsp page, which returns a success message to the client.