org.apache.empire.struts2.action
Interface ActionErrorProvider

All Known Implementing Classes:
WebAction

public interface ActionErrorProvider


Method Summary
 void clearActionErrors()
          clears the action error (if any) and all item errors
 Map<String,ErrorInfo> getItemErrors()
          returns a map of field errors field errors are not persisted on the session and will be lost on redirects.
 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
 String getLocalizedErrorMessage(ErrorInfo error)
          return the localized message for an error
 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
 

Method Detail

hasActionError

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

Returns:
true if either an Action Error or a Field Error has been set

clearActionErrors

void clearActionErrors()
clears the action error (if any) and all item errors


getLastActionError

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.

Parameters:
clear - flag that determines whether to remove this error from the session or not
Returns:
the last Action error that has been put on the session

getItemErrors

Map<String,ErrorInfo> getItemErrors()
returns a map of field errors field errors are not persisted on the session and will be lost on redirects.

Returns:
the map of field errors containing the field name in the key.

getLocalizedErrorMessage

String getLocalizedErrorMessage(ErrorInfo error)
return the localized message for an error

Returns:
the error message in the curren user's language

getLastActionMessage

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

Returns:
an action message for the user


Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.