com.softslate.commerce.customer.customer
Class AccountAction
java.lang.Object
org.apache.struts.action.Action
com.softslate.commerce.customer.core.BaseAction
com.softslate.commerce.customer.customer.AccountAction
- Direct Known Subclasses:
- AccountAddressesAction, AccountHistoryAction, AccountPasswordAction, LostPasswordFormAction, OrderDetailsAction, RegisterFormAction, UpdateAddressesAction, UpdatePasswordAction
- public class AccountAction
- extends BaseAction
Struts action class that corresponds to the store's "Your Account" link. Used
for requests to "/Account.do" and as a superclass for all of the other action
classes in the customer account area.
The execute
method of this class checks to see if the user is
currently logged in. If so, it returns the ActionForward
named
"accountHome". If not, it initializes instances of
LoginForm
and
RegisterForm
in the
request and returns the ActionForward
named "accountLogin".
The idea behind AccountAction
is to provide a single
superclass that manages much of the processing related to customer accounts.
This allows developers to easily create custom account screens by extending
AccountAction
.
- Author:
- David Tobey
Field Summary |
(package private) static org.apache.commons.logging.Log |
log
|
Fields inherited from class org.apache.struts.action.Action |
defaultLocale, servlet |
Methods inherited from class org.apache.struts.action.Action |
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, 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 |
log
static org.apache.commons.logging.Log log
AccountAction
public AccountAction()
execute
public org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping,
org.apache.struts.action.ActionForm form,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.lang.Exception
- Throws:
java.lang.Exception
prepareLoginForm
public void prepareLoginForm(AccountForm baseForm)
throws java.lang.Exception
- Initializes an instance of
LoginForm
. Creates the
instance and places it in the request scope as an attribute named
"loginForm".
- Parameters:
baseForm
- The form class corresponding to the current request. Holds
various properties of the request to help action classes
communicate with the rest of the application.
- Throws:
java.lang.Exception
prepareRegisterForm
public void prepareRegisterForm(AccountForm baseForm)
throws java.lang.Exception
- Initializes an instance of
RegisterForm
. Creates
the instance and places it in the request scope as an attribute named
"registerForm" for use by the register form and other screens.
- Parameters:
baseForm
- The form class corresponding to the current request. Holds
various properties of the request to help action classes
communicate with the rest of the application.
- Throws:
java.lang.Exception
prepareAddressesForm
public void prepareAddressesForm(AccountForm baseForm)
throws java.lang.Exception
- Initializes an instance of
AddressesForm
. Creates the
instance and places it in the request scope as an attribute named
"addressForm". If the current user is a logged in customer, populates the
form's properties with information from the customer's account.
- Parameters:
baseForm
- The form class corresponding to the current request. Holds
various properties of the request to help action classes
communicate with the rest of the application.
- Throws:
java.lang.Exception
Copyright © SoftSlate, Inc. 20032005