|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.struts.action.Action
org.apache.struts.actions.BaseAction
org.apache.struts.actions.DispatchAction
org.apache.struts.actions.MappingDispatchAction
org.apache.struts.apps.mailreader.actions.BaseAction
public abstract class BaseAction
Base Action for MailReader application.
All the BaseAction helper methods are prefixed with "do" so that they can be easily distinguished from Struts and Servlet API methods. BaseAction subclasses may also have prive "do" helpers of their own.
Methods are kept in alphabetical order, to make them easier to find.
Field Summary | |
---|---|
protected Log |
log
The Log instance for this application. |
static String |
PASSWORD
Name of password field ["password"]. |
static String |
TASK
Name of task field ["task"]. |
static String |
USERNAME
Name of username field ["username"]. |
Fields inherited from class org.apache.struts.actions.DispatchAction |
---|
clazz, methods, types |
Fields inherited from class org.apache.struts.actions.BaseAction |
---|
messages |
Fields inherited from class org.apache.struts.action.Action |
---|
servlet |
Constructor Summary | |
---|---|
BaseAction()
|
Method Summary | |
---|---|
protected void |
doCancel(HttpSession session,
String method,
String key)
Helper method to log event and cancel transaction. |
protected ActionForward |
doFindFailure(ActionMapping mapping)
Return the local or global forward named "failure" or null if there is no such forward. |
protected ActionForward |
doFindLogon(ActionMapping mapping)
Return the local or global forward named "logon" or null if there is no such forward. |
protected ActionForward |
doFindSuccess(ActionMapping mapping)
Return the mapping labeled "success" or null if there is no such mapping. |
protected String |
doGet(ActionForm form,
String property)
Helper method to fetch a String property from a DynaActionForm. |
protected Subscription |
doGetSubscription(HttpServletRequest request)
Obtain the cached Subscription object, if any. |
protected Subscription |
doGetSubscription(HttpSession session)
Obtain the cached Subscription object, if any. |
protected User |
doGetUser(HttpServletRequest request)
Helper method to obtain User form session (if any). |
protected User |
doGetUser(HttpSession session)
Helper method to obtain User form session (if any). |
protected UserDatabase |
doGetUserDatabase()
Return a reference to the UserDatabase or null if the database is not available. |
protected ActionForward |
doInputForward(ActionMapping mapping,
HttpServletRequest request,
ActionMessages errors)
Save any errors and the transactioonal token, and forward to the InputForard result. |
protected void |
doLogProcess(ActionMapping mapping,
String method)
Log a "processing" message for an Action. |
protected void |
doSaveToken(HttpServletRequest request)
Helper method to log event and save token. |
protected void |
doSaveUser(User user)
Persist the User object, including subscriptions, to the database. |
protected boolean |
doSet(ActionForm form,
String property,
String value)
Helper method to inject a String property into a DynaActionForm. |
Methods inherited from class org.apache.struts.actions.MappingDispatchAction |
---|
execute, getMethodName, getParameter, unspecified |
Methods inherited from class org.apache.struts.actions.DispatchAction |
---|
cancelled, dispatchMethod, getMethod |
Methods inherited from class org.apache.struts.action.Action |
---|
addErrors, addMessages, execute, generateToken, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static String USERNAME
Name of username field ["username"].
public static String PASSWORD
Name of password field ["password"].
public static final String TASK
Name of task field ["task"].
protected Log log
The Log
instance for this application.
Constructor Detail |
---|
public BaseAction()
Method Detail |
---|
protected void doCancel(HttpSession session, String method, String key)
Helper method to log event and cancel transaction.
session
- Our HttpSessionmethod
- Method being processedkey
- Attrkibute to remove from session, if anyprotected ActionForward doFindFailure(ActionMapping mapping)
Return the local or global forward named "failure" or null if there is no such forward.
mapping
- Our ActionMapping
protected ActionForward doFindLogon(ActionMapping mapping)
Return the local or global forward named "logon" or null if there is no such forward.
mapping
- Our ActionMapping
protected ActionForward doFindSuccess(ActionMapping mapping)
Return the mapping labeled "success" or null if there is no such mapping.
mapping
- Our ActionMapping
protected String doGet(ActionForm form, String property)
Helper method to fetch a String property from a DynaActionForm.
Values are returned trimmed of leading and trailing whitespace. Zero-length strings are returned as null.
form
- Our DynaActionFormproperty
- The name of the property
protected Subscription doGetSubscription(HttpSession session)
Obtain the cached Subscription object, if any.
session
- Our HttpSession
protected Subscription doGetSubscription(HttpServletRequest request)
Obtain the cached Subscription object, if any.
request
- Our HttpServletRequest
protected UserDatabase doGetUserDatabase()
Return a reference to the UserDatabase or null if the database is not available.
protected User doGetUser(HttpSession session)
Helper method to obtain User form session (if any).
session
- Our HttpSession
protected User doGetUser(HttpServletRequest request)
Helper method to obtain User form session (if any).
request
- Our HttpServletRequest
protected ActionForward doInputForward(ActionMapping mapping, HttpServletRequest request, ActionMessages errors)
Save any errors and the transactioonal token, and forward to the InputForard result.
mapping
- Our ActionMappingrequest
- Our HttpServletRequesterrors
- Our ActionMessages collectoin
protected void doLogProcess(ActionMapping mapping, String method)
Log a "processing" message for an Action.
mapping
- Our ActionMappingmethod
- Name of method being processedprotected void doSaveToken(HttpServletRequest request)
Helper method to log event and save token.
request
- Our HttpServletRequestprotected void doSaveUser(User user) throws ServletException
Persist the User object, including subscriptions, to the database.
user
- Our User object
ServletException
- On any errorprotected boolean doSet(ActionForm form, String property, String value)
Helper method to inject a String property into a DynaActionForm.
form
- Our DynaActionFormproperty
- The name of the propertyvalue
- The value for the property
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |