| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_DIR |
| Constructor and Description |
|---|
ValidationFilter() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Gives a chance to the filter to deallocalte any resources before it is destroyed.
|
String |
filter(InvocationChain chain)
Executes the filter.
|
static boolean |
isPost(Action action) |
void |
prepareValidator(Validator validator,
Action action,
String innerAction)
Implement this abstract method to add rules to the fields you want to validate.
|
void |
setDir(String dir)
Sets the directory where to look for error messages.
|
void |
setMessageContext(MessageContext msgContext)
Sets the MessageContext from where you want to get the error messsages.
|
void |
setResultForError(String resultForError)
By default, the filter returns the BaseAction.ERROR when a validation failure happens.
|
public static final String DEFAULT_DIR
public void prepareValidator(Validator validator, Action action, String innerAction)
public void setResultForError(String resultForError)
resultForError - The result to return in case of a validation failure.public void setMessageContext(MessageContext msgContext)
msgContext - The MessageContext to use instead of the default one.public static boolean isPost(Action action)
public void setDir(String dir)
dir - The directory where to look for error messages.public String filter(InvocationChain chain) throws Exception
Filterpublic void destroy()
FilterCopyright © 2015. All Rights Reserved.