|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.empire.struts2.actionsupport.ActionBase
org.apache.empire.struts2.action.WebAction
public abstract class WebAction
WebAction should be used as the superclass for all your struts2 action classes.
It implements necessary interfaces for parameter-, translation- and error-handling.
| Field Summary | |
|---|---|
static String |
DEFAULT_ITEM_PROPERTY_NAME
|
protected static org.slf4j.Logger |
log
|
static String |
PORTLET_ACTION_RESULT
|
| Fields inherited from interface org.apache.empire.struts2.action.Disposable |
|---|
EXITCODE_ERROR, EXITCODE_SUCCESS |
| Constructor Summary | |
|---|---|
WebAction()
|
|
| Method Summary | |
|---|---|
protected void |
addFieldError(String name,
Column column,
ErrorInfo error)
|
protected void |
addItemError(String item,
ErrorType errorType,
String title,
ErrorInfo error)
|
void |
clearActionErrors()
clears the action error (if any) and all item errors |
void |
clearItem()
|
int |
dispose()
Cleanup resources allocated by the action this requires the action to be stored on the request in a param named "action" the ActionBasicsInterceptor performs this task the dispose method will then be called from the EmpireStrutsDispatcher |
protected String |
getActionParam(String name)
|
String |
getActionURL(String action,
Map<String,Object> parameters)
Deprecated. |
protected Connection |
getConnection()
|
String |
getItem()
|
Map<String,ErrorInfo> |
getItemErrors()
returns a map of field errors field errors are not persisted on the session and will be lost on redirects. |
protected Object[] |
getItemKey()
|
protected boolean |
getItemNewFlag()
|
String |
getItemPropertyName()
returns the name of the parameter used to get and set the action's item This function is used by the jsp tags as default parameter name of the item attribute By default this ist the name "item" |
ErrorInfo |
getLastActionError(boolean clear)
returns the last Action Error of the current or a previous aciton the error is left on the session unless the clear flag is set to true In order to display the error to the user an application should use this function instead of getActionError() and set clear to true. |
String |
getLastActionMessage(boolean clear)
returns the last set Action Message the message is left on the session unless the clear flag is set to true |
int |
getListPageSize()
|
Locale |
getLocale()
|
String |
getLocalizedErrorMessage(ErrorInfo error)
return the localized message for an error |
String[] |
getRequestArrayParam(String param)
|
Integer |
getRequestIntParam(String param)
|
String |
getRequestParam(String param)
|
Map<String,Object> |
getRequestParameters()
|
String |
getText(String aTextName)
|
String |
getText(String aTextName,
List<Object> args)
|
String |
getText(String aTextName,
String defaultValue)
|
String |
getText(String key,
String[] args)
|
String |
getText(String aTextName,
String defaultValue,
List<Object> args)
|
String |
getText(String key,
String defaultValue,
List<Object> args,
com.opensymphony.xwork2.util.ValueStack stack)
|
String |
getText(String aTextName,
String defaultValue,
String obj)
|
String |
getText(String key,
String defaultValue,
String[] args)
|
String |
getText(String key,
String defaultValue,
String[] args,
com.opensymphony.xwork2.util.ValueStack stack)
|
ResourceBundle |
getTexts()
|
ResourceBundle |
getTexts(String aBundleName)
|
String |
handleException(Throwable exception,
String method)
handle any exception that may have occurred The method is called from the ActionBasicsInterceptor |
boolean |
hasAccess(String method)
Determines whether the user has access to this page or a particular method The method is called from the ActionAccessInterceptor |
boolean |
hasActionError()
returns true if the current action has either an action or a field error WARNING: this function returns false if a previous action had an error |
protected boolean |
hasItem(boolean lookOnSession)
|
boolean |
hasKey(String key)
|
boolean |
hasRequestParam(String param)
|
void |
init()
Initialize the action Should be used instead of the constructor to initialize the action The method is called from the ActionBasicsInterceptor |
boolean |
isNewItem()
|
boolean |
loginRequired()
Determines whether the user needs to Login to access this page important: return false if the user has already logged in! The method is called from the ActionAccessInterceptor |
void |
putRequestParam(String name,
String value)
|
String |
renderPortlet()
|
protected void |
setActionError(ErrorInfo error)
|
protected void |
setActionError(ErrorType errType)
|
protected void |
setActionError(ErrorType errType,
String param)
|
void |
setActionError(Exception exception)
|
protected void |
setActionMessage(String message)
|
void |
setItem(String value)
|
| Methods inherited from class org.apache.empire.struts2.actionsupport.ActionBase |
|---|
getActionBean, getActionBean, getActionBeanName, getActionObject, getActionObjectName, getRecordKeyExpr, getRecordKeyFromString, getRecordKeyString, getRecordKeyString, getRecordNewFlagFromString, putActionBean, putActionBean, putActionObject, removeActionBean, removeActionBean, removeActionObject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.slf4j.Logger log
public static String DEFAULT_ITEM_PROPERTY_NAME
public static String PORTLET_ACTION_RESULT
| Constructor Detail |
|---|
public WebAction()
| Method Detail |
|---|
public void init()
init in interface Disposablepublic int dispose()
dispose in interface Disposable
public String handleException(Throwable exception,
String method)
handleException in interface ExceptionAwareexception - the exception that occurred
public boolean loginRequired()
loginRequired in interface ActionAccessValidatorpublic boolean hasAccess(String method)
hasAccess in interface ActionAccessValidatorpublic boolean hasActionError()
ActionErrorProvider
hasActionError in interface ActionErrorProviderpublic void clearActionErrors()
ActionErrorProvider
clearActionErrors in interface ActionErrorProviderpublic ErrorInfo getLastActionError(boolean clear)
ActionErrorProvider
getLastActionError in interface ActionErrorProviderclear - flag that determines whether to remove this error from the session or not
public String getLocalizedErrorMessage(ErrorInfo error)
ActionErrorProvider
getLocalizedErrorMessage in interface ActionErrorProviderprotected void setActionError(ErrorInfo error)
protected final void setActionError(ErrorType errType)
protected final void setActionError(ErrorType errType,
String param)
public final void setActionError(Exception exception)
setActionError in class ActionBasepublic Map<String,ErrorInfo> getItemErrors()
ActionErrorProvider
getItemErrors in interface ActionErrorProvider
protected void addItemError(String item,
ErrorType errorType,
String title,
ErrorInfo error)
protected void addFieldError(String name,
Column column,
ErrorInfo error)
addFieldError in class ActionBasepublic String getLastActionMessage(boolean clear)
ActionErrorProvider
getLastActionMessage in interface ActionErrorProviderprotected void setActionMessage(String message)
public Locale getLocale()
getLocale in interface com.opensymphony.xwork2.LocaleProviderpublic boolean hasKey(String key)
hasKey in interface com.opensymphony.xwork2.TextProviderpublic String getText(String aTextName)
getText in interface com.opensymphony.xwork2.TextProvider
public String getText(String aTextName,
String defaultValue)
getText in interface com.opensymphony.xwork2.TextProvider
public String getText(String aTextName,
String defaultValue,
String obj)
getText in interface com.opensymphony.xwork2.TextProvider
public String getText(String aTextName,
List<Object> args)
getText in interface com.opensymphony.xwork2.TextProvider
public String getText(String key,
String[] args)
getText in interface com.opensymphony.xwork2.TextProvider
public String getText(String aTextName,
String defaultValue,
List<Object> args)
getText in interface com.opensymphony.xwork2.TextProvider
public String getText(String key,
String defaultValue,
String[] args)
getText in interface com.opensymphony.xwork2.TextProvider
public String getText(String key,
String defaultValue,
List<Object> args,
com.opensymphony.xwork2.util.ValueStack stack)
getText in interface com.opensymphony.xwork2.TextProvider
public String getText(String key,
String defaultValue,
String[] args,
com.opensymphony.xwork2.util.ValueStack stack)
getText in interface com.opensymphony.xwork2.TextProviderpublic ResourceBundle getTexts()
getTexts in interface com.opensymphony.xwork2.TextProviderpublic ResourceBundle getTexts(String aBundleName)
getTexts in interface com.opensymphony.xwork2.TextProviderpublic int getListPageSize()
getListPageSize in class ActionBaseprotected Connection getConnection()
getConnection in class ActionBasepublic String getItemPropertyName()
ActionItemProperty
getItemPropertyName in interface ActionItemPropertypublic String getItem()
public void setItem(String value)
public void clearItem()
public boolean isNewItem()
protected final boolean hasItem(boolean lookOnSession)
protected final Object[] getItemKey()
protected final boolean getItemNewFlag()
public final Map<String,Object> getRequestParameters()
getRequestParameters in interface RequestParamProviderpublic final boolean hasRequestParam(String param)
hasRequestParam in interface RequestParamProviderpublic final String getRequestParam(String param)
getRequestParam in interface RequestParamProviderpublic final String[] getRequestArrayParam(String param)
getRequestArrayParam in interface RequestParamProviderpublic final Integer getRequestIntParam(String param)
public final void putRequestParam(String name,
String value)
protected String getActionParam(String name)
@Deprecated
public String getActionURL(String action,
Map<String,Object> parameters)
public String renderPortlet()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||