The Struts framework provides data validation based on java beans
(ActionForm). The Bank Transformation Toolkit also provides data
validation based on the contexts. You can use both in your application. You
can write your own validation class and put it into the Struts configuration
file, as follows:
<action name="financialInfoForm"
path="/finacialFinal"
className="com.ibm.btt.struts.config.BTTEJBActionMapping"
type="com.ibm.btt.struts.actions.EJBAction"
input="/requestDataPage.jsp"
invokerId="financialfinalinvoker"
validator="com.ibm.btt.samples.html.FinancialInfoXVal">
In the example above, the Struts framework will call the com.ibm.btt.samples.html.FinancialInfoXVal
validation class when the financialInfoForm action is called.
When
map Http Request data to screen flow context directly, BTT Validation would
take over the field validation. The following is BTT validation definition:
<action name=" transferNomalForm "
path="/confirmTransfer"
className="com.ibm.btt.struts.config.BTTEJBActionMapping"
type="com.ibm.btt.struts.actions.transferAction"
input="/transfer.jsp"
validator="com.ibm.btt.samples.html.TransferXVal">
<forward name="success" path="/transferConfirm.jsp"/>
</action>
All validation classes should implement the interface com.ibm.btt.struts.base.OperationXValidate.
public interface OperationXValidate {
/** To validate each filed **/.
public void validate(Object name,Object value) throws DSETypeException;
/** To do cross-validation **/.
public String[] xValidate(Context ctx);
}