struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Norman Klein <>
Subject How is property field used in errors.add
Date Fri, 06 Dec 2002 19:48:23 GMT

We are using just standard validation using a validate method within the

There are a series of validations, which look like the following:

	public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {

		ActionErrors errors = new ActionErrors();

		if (getCG_Branch() == null || getCG_Branch().length() < 1) {
			errors.add("CG_Branch", new
ActionError("errors.required", "Contact General: Branch"));
			System.out.println("getCG_Branch failed.
Contact_General_LoanAction will not executed");

        		return errors;

The "Contact General: Branch" is passed as a parameter to errors:required
(which is specified in the file)

	{0} is required

According to the Struts documentation, the "errors.add" call

	void add(java.lang.String property, ActionError error) 
	Add an error message to the set of errors for the specified

So what functionality does this specified property provide??

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message