FileDocCategorySizeDatePackage
LogonAction.javaAPI DocExample1265Sat Sep 04 12:46:40 BST 2004com.oreilly.strutsckbk.ch11.ams

LogonAction

public final class LogonAction extends org.apache.struts.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)


        HttpSession session = request.getSession();

        ActionErrors errors = new ActionErrors();

        String username = (String) PropertyUtils.getSimpleProperty(form, "username");
        String password = (String) PropertyUtils.getSimpleProperty(form, "password");

        User user = new User(username);
        
        session.setAttribute("user", user);

        return mapping.findForward("success");