struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Norman Klein <norman.kl...@first-franklin.com>
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
ActionForm

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 ApplicationsResources.properties 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
property.

So what functionality does this specified property provide??

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message