The meaning of action's context in Interface ActionValidatorManager method validate

165 Views Asked by At

I wanted to use the following method for validation through XMLs on clientside.

Can someone please tell me about the context of an action as said in the following method: Interface ActionValidatorManager:

void validate(Object object, String context) throws ValidationException

Validates the given object using action and its context.
Parameters:
object - the action to validate.
context - the action's context.
Throws: ValidationException - if an error happens when validating the action.

I am not able to understand the meaning of action's context in this method.

1

There are 1 best solutions below

0
On

The action context is meant as validation context in terms of validation framework. The actual description

The context that will be used by the ActionValidatorManager to associate the action invocation with the appropriate ValidatorConfig.

The context returned is used in the pattern ActionClass-context-validation.xml

The default context is the action name from the URL, but the method can be overridden to implement custom contexts.

This can be useful in cases in which a single action and a single model require vastly different validation based on some condition.