Concept of Struts2.0 Work Flow Interceptor

Concept of Struts2.0 Work Flow Interceptor

Previous Home Next

 

This interceptor is responsible for invoking the validation. The validating action properties define by the action and changing the workflow of request processing if any validation failed.


 
The WorkFlow interceptor required that action implements following interface

1.Validatable
2.ValidationAware
 
Validatable:-This interface provide a single method name validate() that is define by the application developer to validate action properties.
 
public void validate();
 
ValidationAware:-This interface provides a method for handling error message and other message to be display along with fields on a form.
 
Commonly used method in ValidationAware Interface:-

public void addActionError(String errorMessage);
public void addActionMessage(String message);
public void addFieldError(String fieldname,String fieldMessage);
public void addFieldMessage(String fieldname,String fieldMessage);

Previous Home Next