Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/clra/web/MemberInfoAction.java


1   /*
2    * Copyright (c) Carnegie Lake Rowing Association 2002. All rights reserved.
3    * Distributed under the GPL license. See doc/COPYING.
4    * $RCSfile: MemberInfoAction.java,v $
5    * $Date: 2003/02/26 03:38:46 $
6    * $Revision: 1.2 $
7    */
8   
9   package com.clra.web;
10  
11  /**
12   * A workflow manager that sets up an input form 
13   * for a member's personal info
14   * @author <a href="mailto:jmstone@nerc.com">Jan Stone</a>
15   */
16  
17  import com.clra.web.MemberView;
18  import com.clra.web.MemberTag;
19  import com.clra.member.MemberName;
20  import com.clra.util.ErrorUtils;
21  
22  import java.io.IOException;
23  import java.util.ArrayList;
24  import java.util.Collection;
25  import javax.ejb.CreateException;
26  import javax.naming.NamingException;
27  import javax.servlet.ServletException;
28  import javax.servlet.http.HttpServletRequest;
29  import javax.servlet.http.HttpSession;
30  import javax.servlet.http.HttpServletResponse;
31  import org.apache.log4j.Category;
32  import org.apache.struts.action.Action;
33  import org.apache.struts.action.ActionForm;
34  import org.apache.struts.action.ActionForward;
35  import org.apache.struts.action.ActionMapping;
36  
37  public final class MemberInfoAction extends Action {
38  
39    private final static String base = MemberInfoAction.class.getName();
40    private final static Category theLog = Category.getInstance( base );
41  
42    /**
43     * Handle the workflow step in which a form is popluated with date from
44     * a member's data.
45     **/
46    public ActionForward perform( ActionMapping mapping, ActionForm form,
47      HttpServletRequest request, HttpServletResponse response )
48        throws IOException, ServletException {
49  
50      // A null return value indicates that processing should continue
51      ActionForward retVal = null;
52  
53      // Extract the workflow action
54      HttpSession session = request.getSession();
55      String action = request.getParameter("action");
56      if (action == null) {
57        theLog.error( "null action" );
58        // FIXME add error message
59        retVal = mapping.findForward("failure");
60      }
61  
62      // Remove the obsolete form bean
63      if (mapping.getAttribute() != null) {
64        if ("request".equals(mapping.getScope())) {
65          request.removeAttribute(mapping.getAttribute());
66        }
67        else {
68          session.removeAttribute(mapping.getAttribute());
69        }
70      }
71  
72      return retVal;
73    }
74   
75  }