Struts

Concept of Struts2.0 Work Flow Interceptor
adplus-dvertising
Previous Home Next

Introduction:

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.

Class/Library File Descriptions:-

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