FileDocCategorySizeDatePackage
SaveUserAction.javaAPI DocExample1165Thu Oct 28 00:13:46 BST 2004com.oreilly.strutsckbk.ch14

SaveUserAction

public class SaveUserAction extends com.oroad.stxx.action.Action

Fields Summary
Constructors Summary
Methods Summary
public org.apache.struts.action.ActionForwardexecute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)

 

        List usersList = (List) getServlet().getServletContext().getAttribute("users");
        JDOMForm jdomForm = (JDOMForm) form;
        String firstName = jdomForm.getValue("/user/name/firstname");
        String lastName  = jdomForm.getValue("/user/name/lastname");
        String email     = jdomForm.getValue("/user/email");
        usersList.add(new User(firstName, lastName, email));
        return mapping.findForward("success");