SVT (Struts Validation Toolkit) is a form validation framework for Struts.
You can write a simple validating code in Java, rather than writing validation.xml files (which is supported in Struts 1.1). This enables you to do conditional validation, based on other properties, request, session or whatever.
If the form bean has properties "name" and "age", both is required, and "age" must be a number, the validation code looks like this:
public class InputForm extends ActionForm { .... public ActionErrors validate( ActionMapping mapping, HttpServletRequest request) { Validator v = new Validator(getServlet(), this, mapping.getName()); v.validate("name", Rules.required()); v.validate("age", new Rule[] { Rules.required(), Rules.number() }); return v.getErrors(); } }