dgraham 2003/08/27 16:44:02 Modified: src/share/org/apache/struts/validator ValidatorPlugIn.java Log: javadoc cleanup and minor formatting changes. Revision Changes Path 1.19 +31 -21 jakarta-struts/src/share/org/apache/struts/validator/ValidatorPlugIn.java Index: ValidatorPlugIn.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/validator/ValidatorPlugIn.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- ValidatorPlugIn.java 28 Jul 2003 05:54:10 -0000 1.18 +++ ValidatorPlugIn.java 27 Aug 2003 23:44:02 -0000 1.19 @@ -77,8 +77,8 @@ import org.apache.struts.config.ModuleConfig; /** - * <p>Loads <code>ValidatorResources</code> based on - * configuration in the struts-config.xml.</p> + * Loads <code>ValidatorResources</code> based on configuration in the + * struts-config.xml file. * * @author David Winterfeldt * @version $Revision$ $Date$ @@ -109,12 +109,15 @@ /** * Application scope key that <code>ValidatorResources</code> is stored under. */ - public final static String VALIDATOR_KEY = "org.apache.commons.validator.VALIDATOR_RESOURCES"; + public final static String VALIDATOR_KEY = + "org.apache.commons.validator.VALIDATOR_RESOURCES"; /** * Application scope key that <code>StopOnError</code> is stored under. + * @since Struts 1.2 */ - public final static String STOP_ON_ERROR_KEY = "org.apache.struts.validator.STOP_ON_ERROR"; + public final static String STOP_ON_ERROR_KEY = + "org.apache.struts.validator.STOP_ON_ERROR"; /** * The set of Form instances that have been created and initialized, @@ -147,28 +150,32 @@ } /** - * Informs the Validators if it has to stop validation when finding the first Error - * or if it should continue. - * Default to true to keep struts 1.1 backwards compatibility. + * Informs the Validators if it has to stop validation when finding the + * first error or if it should continue. Default to <code>true</code> to + * keep Struts 1.1 backwards compatibility. */ private boolean stopOnFirstError = true; /** * Gets the value for stopOnFirstError. - * @return a boolean indicating whether javascript validator should stop when finds the first error - * ,struts 1.1 behaviour, or continue validation. + * @return A boolean indicating whether JavaScript validation should stop + * when it finds the first error (Struts 1.1 behaviour) or continue + * validation. + * @since Struts 1.2 */ public boolean isStopOnFirstError() { - return stopOnFirstError; + return this.stopOnFirstError; } /** * Sets the value for stopOnFirstError. - * @param newValue a boolean indicating whether javascript validator should stop when finds the first error - * ,struts 1.1 behaviour, or continue validation. + * @param stopOnFirstError A boolean indicating whether JavaScript + * validation should stop when it finds the first error + * (Struts 1.1 behaviour) or continue validation. + * @since Struts 1.2 */ - public void setStopOnFirstError(boolean newValue) { - this.stopOnFirstError = newValue; + public void setStopOnFirstError(boolean stopOnFirstError) { + this.stopOnFirstError = stopOnFirstError; } /** @@ -188,13 +195,16 @@ // Load our database from persistent storage try { - initResources(); + this.initResources(); + servlet.getServletContext().setAttribute( VALIDATOR_KEY + config.getPrefix(), resources); + servlet.getServletContext().setAttribute( - STOP_ON_ERROR_KEY + '.'+config.getPrefix(), - new Boolean(stopOnFirstError)); + STOP_ON_ERROR_KEY + '.' + config.getPrefix(), + new Boolean(this.stopOnFirstError)); + } catch (Exception e) { log.error(e.getMessage(), e); throw new UnavailableException(
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]