FileDocCategorySizeDatePackage
BaseAction.javaAPI DocExample1324Sat Sep 04 12:16:30 BST 2004com.oreilly.strutsckbk.ch11.ams

BaseAction

public abstract class BaseAction extends org.apache.struts.action.Action

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

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();
        User user = (User) session.getAttribute("user");
        if (user == null) {
            user = getUser(request);
            if (user != null) session.setAttribute("user", user);
        }
        return doExecute(mapping, form, request, response);
    
protected UsergetUser(javax.servlet.http.HttpServletRequest request)

        return request.getUserPrincipal() == null ? 
               null : 
               new User(request.getUserPrincipal().getName());