01: package hero.struts.actions;
02:
03: import java.io.IOException;
04: import javax.servlet.ServletException;
05: import javax.servlet.http.HttpServletRequest;
06: import javax.servlet.http.HttpServletResponse;
07: import org.apache.struts.action.Action;
08: import org.apache.struts.action.ActionForm;
09: import org.apache.struts.action.ActionForward;
10: import org.apache.struts.action.ActionMapping;
11: import javax.naming.Context;
12:
13: /**
14: * This is the base class from which all Action classes that use
15: * Struts can be derived from.
16: *
17: * @author Miguel Valdes Faura
18: *
19: */
20: public abstract class AbstStrutsActionBase extends Action {
21:
22: /* Generic typical returns used so that the structs-config.xml can
23: * default global forwards.
24: */
25:
26: protected static final String INITIAL = "initial";
27: protected static final String SUCCESS = "success";
28: protected static final String FAILURE = "failure";
29: protected static final String ERROR = "error";
30: protected static final String LOGIN = "login";
31: protected static final String NEWUSER = "newuser";
32: protected static final String CONFIRM = "confirm";
33: protected static final String ACTIVITY = "activity";
34: protected static final String EDITACTIVITY = "editactivity";
35: protected static final String PROJECT = "project";
36: protected static final String ADMIN = "admin";
37: protected static final String USER = "user";
38: protected static final String ADDPROJECT = "addproject";
39: protected static final String CLONEPROJECT = "cloneproject";
40: protected static final String PROJECTDETAILS = "projectdetails";
41: protected static final String USERNOTLOGGED = "usernotlogged";
42: protected static final String WORKLIST = "worklist";
43: protected static final String CONFIGPROJECT = "configproject";
44:
45: protected Context jndiContext = null;
46:
47: /**
48: * Default constructor
49: */
50: public AbstStrutsActionBase() {
51: }
52:
53: /**
54: * @param mapping The ActionMapping used to select this instance
55: * @param actionForm The optional ActionForm bean for this request (if any)
56: * @param request The HTTP request we are processing
57: * @param response The HTTP response we are creating
58: * @throws IOException if an input/output error occurs
59: * @throws ServletException if a servlet exception occurs
60: * @return where control will be forwarded to after this request is processed
61: */
62: public abstract ActionForward perform(ActionMapping mapping,
63: ActionForm form, HttpServletRequest request,
64: HttpServletResponse response) throws IOException,
65: ServletException;
66:
67: {
68: }
69:
70: }
|