Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Struts Wiki" for change 
notification.

The following page has been changed by MichaelJouravlev:
http://wiki.apache.org/struts/StrutsQuickStart4

New page:
== Data editing and full-blown CRUD application ==

Now when we know how to view and delete an employee, let us add the missing 
parts: creation, update and saving of modified employee data. 

The EmployeeAction class handles "create", "view", "edit", "duplicate", "save", 
"delete" and "close" events, this is how it is configured:

{{{<action path  = "/employeesListCRUD"
        type  = "actions.EmployeesListAction">
  <forward name = "render" path = "/jspstruts4/employees.jsp"/>
</action>

<action path  = "/employeeActionCRUD"
        type  = "actions.EmployeeAction"
        name  = "crudform"
        scope = "request"
        validate  = "false"
        parameter = 
"create,view,edit,duplicate,save=validateAndSave,delete,close">
  <forward name = "renderedit" path = "/jspstruts4/employee-edit.jsp"/>
  <forward name = "renderpreview" path = "/jspstruts4/employee-view.jsp"/>
  <forward name = "finished" path = "/employeesListCRUD.do" redirect = "true"/>
</action>}}}

The {{{EmployeeAction}}} class is not very complicated, but you better dowload 
the sample WAR file with the source code: attachment:crud.war.

Reply via email to