|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.action.Action com.pow2.struts.action.BaseAction
Pow2 Struts base action.
This class adds base utility methods to other Action subclasses.
It also provides the validateSession
hook method;
the default implementation always returns true
.
To implement your own session validation, extend this class and
override the the validateSession
method.
if validateSession
returns false
, this action
forwards to the resource specified by the "invalidSession" ActionForward
object.
Field Summary | |
protected org.apache.log4j.Category |
cat
Log4j category |
protected static String |
FWD_CANCEL
ActionForward cancel string |
protected static String |
FWD_FAILURE
ActionForward failure string |
protected static String |
FWD_INVALID_SESSION
ActionForward invalid session string |
protected static String |
FWD_LOGIN
ActionForward failure string |
Fields inherited from class org.apache.struts.action.Action |
ACTION_SERVLET_KEY, APPLICATION_KEY, DATA_SOURCE_KEY, defaultLocale, ERROR_KEY, EXCEPTION_KEY, FORM_BEANS_KEY, FORWARDS_KEY, LOCALE_KEY, MAPPING_KEY, MAPPINGS_KEY, MESSAGE_KEY, MESSAGES_KEY, MULTIPART_KEY, PLUG_INS_KEY, REQUEST_PROCESSOR_KEY, servlet, SERVLET_KEY, TRANSACTION_TOKEN_KEY |
Constructor Summary | |
BaseAction()
|
Method Summary | |
protected org.apache.struts.action.ActionForward |
failureForward(HttpServletRequest request,
org.apache.struts.action.ActionMapping mapping,
org.apache.struts.action.ActionErrors errors,
String errorKey)
Get the FWD_FAILURE ActionForward object, and store the
error message identified by the errorKey string into the input
ActionErrors object. |
protected org.apache.struts.action.ActionForward |
getForward(HttpServletRequest request,
org.apache.struts.action.ActionMapping mapping,
org.apache.struts.action.ActionErrors errors,
String forward,
String errorKey)
Get the ActionForward object related to the input forward string,
and store the error message identified by the errorKey string into
the input ActionErrors object. |
protected org.apache.struts.action.ActionForward |
invalidSessionForward(HttpServletRequest request,
org.apache.struts.action.ActionMapping mapping,
org.apache.struts.action.ActionErrors errors)
Get the FWD_INVALID_SESSION ActionForward object, and store
the error message identified by the KEY_INVALID_SESSION key
into the input ActionErrors object. |
protected boolean |
isFailureForward(org.apache.struts.action.ActionForward forward)
Check if the input ActionForward object is a failure forward |
protected org.apache.struts.action.ActionForward |
loginForward(HttpServletRequest request,
org.apache.struts.action.ActionMapping mapping)
Get the FWD_LOGIN ActionForward object. |
protected org.apache.struts.action.ActionForward |
loginForward(HttpServletRequest request,
org.apache.struts.action.ActionMapping mapping,
org.apache.struts.action.ActionErrors errors,
String errorKey)
Get the FWD_LOGIN ActionForward object, and store the
error message identified by the errorKey string into the input
ActionErrors object. |
protected boolean |
validateSession(HttpServletRequest request)
Check if the current session is valid. |
Methods inherited from class org.apache.struts.action.Action |
execute, execute, generateToken, getDataSource, getDataSource, getLocale, getResources, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, perform, perform, resetToken, saveErrors, saveMessages, saveToken, setLocale, setServlet, toHex |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final String FWD_CANCEL
protected static final String FWD_FAILURE
protected static final String FWD_LOGIN
protected static final String FWD_INVALID_SESSION
protected org.apache.log4j.Category cat
Constructor Detail |
public BaseAction()
Method Detail |
protected org.apache.struts.action.ActionForward loginForward(HttpServletRequest request, org.apache.struts.action.ActionMapping mapping)
FWD_LOGIN
ActionForward object.
request
- the HttpServletRequest objectmapping
- the ActionMapping object
protected org.apache.struts.action.ActionForward loginForward(HttpServletRequest request, org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionErrors errors, String errorKey)
FWD_LOGIN
ActionForward object, and store the
error message identified by the errorKey string into the input
ActionErrors object.
request
- the HttpServletRequest objectmapping
- the ActionMapping objecterrors
- the ActionErrors objecterrorKey
- a string key identifying a resource properties error string
protected org.apache.struts.action.ActionForward failureForward(HttpServletRequest request, org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionErrors errors, String errorKey)
FWD_FAILURE
ActionForward object, and store the
error message identified by the errorKey string into the input
ActionErrors object.
request
- the HttpServletRequest objectmapping
- the ActionMapping objecterrors
- the ActionErrors objecterrorKey
- a string key identifying a resource properties error string
protected org.apache.struts.action.ActionForward invalidSessionForward(HttpServletRequest request, org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionErrors errors)
FWD_INVALID_SESSION
ActionForward object, and store
the error message identified by the KEY_INVALID_SESSION
key
into the input ActionErrors object.
request
- the HttpServletRequest objectmapping
- the ActionMapping objecterrors
- the ActionErrors objects
protected org.apache.struts.action.ActionForward getForward(HttpServletRequest request, org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionErrors errors, String forward, String errorKey)
forward
string,
and store the error message identified by the errorKey string into
the input ActionErrors object.
request
- the HttpServletRequest objectmapping
- the ActionMapping objecterrors
- the ActionErrors objectforward
- the name of the action forward object to retrieveerrorKey
- a string key identifying a resource properties error string
protected boolean isFailureForward(org.apache.struts.action.ActionForward forward)
forward
- the ActionForward object to checkprotected boolean validateSession(HttpServletRequest request)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |