1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
public class UserEditAction extends DispatchAction {
/**
* loads the book specified by the id from the database and forwards to the
edit form
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward editUser(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
//Modifier utilisateur form
UserEditForm userEditForm = (UserEditForm) form;
String id = request.getParameter("idUser");
...
return mapping.findForward("showYEdit");
}
/**
* forwards to the add book form
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward addUser(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
//System.out.println("add user");
UserEditForm userEditForm = (UserEditForm) form;
.....
return mapping.findForward("showYAdd");
}
/**
* updates or creates the book in the database
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward saveUser(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
UserEditForm userEditForm = (UserEditForm) form;
....
return mapping.findForward("showYList");
}
public ActionForward delUser(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
UserEditForm userEditForm = (UserEditForm) form;
String id = request.getParameter("idUser");
....
return mapping.findForward("showYList");
}
} |
Partager