[cvs] expresso commit by lhamel: revert to v.1.16;
Raul says the 1.17 commit
JCorporate Ltd
jcorp at jcorporate.com
Wed Dec 8 20:34:35 UTC 2004
Log Message:
-----------
revert to v.1.16; Raul says the 1.17 commit was a mistake
Modified Files:
--------------
expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller:
DefaultForm.java
Revision Data
-------------
Index: DefaultForm.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller/DefaultForm.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller/DefaultForm.java -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller/DefaultForm.java -u -r1.17 -r1.18
--- expresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller/DefaultForm.java
+++ expresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller/DefaultForm.java
@@ -86,8 +86,6 @@
import java.util.Iterator;
import java.util.Locale;
import java.util.StringTokenizer;
-import java.util.Map;
-import org.apache.struts.util.RequestUtils;
/**
@@ -234,7 +232,6 @@
return errors;
}
-
/**
* Validate the properties that have been set from this HTTP request,
* and return an <code>ActionErrors</code> object that encapsulates any
@@ -412,87 +409,27 @@
ActionErrors errors,
int page) {
+ ValidatorResources resources = Resources.getValidatorResources(application,
+ request);
- ValidatorResources resources =
- Resources.getValidatorResources(application, request);
-
- Locale locale = RequestUtils.getUserLocale(request, null);
+ Locale locale = Resources.getLocale(request);
Validator validator = new Validator(resources, key);
validator.setUseContextClassLoader(true);
validator.setPage(page);
- validator.setParameter(Resources.SERVLET_CONTEXT_KEY, application);
- validator.setParameter(Resources.HTTP_SERVLET_REQUEST_KEY, request);
- validator.setParameter(Validator.LOCALE_PARAM, locale);
- validator.setParameter(Resources.ACTION_ERRORS_KEY, errors);
- validator.setParameter(Validator.BEAN_PARAM, bean);
+ validator.addResource(Resources.
+ SERVLET_CONTEXT_KEY, application);
+ validator.addResource(Resources.
+ HTTP_SERVLET_REQUEST_KEY, request);
+ validator.addResource(Validator.LOCALE_KEY, locale);
+ validator.addResource(Resources.
+ ACTION_ERRORS_KEY, errors);
+ validator.addResource(Validator.BEAN_KEY, bean);
return validator;
-
- }
-
- /**
- * Get results of the validation performed by the
- * <code>Validator</code>.
- * @return results of the validation
- */
- public ValidatorResults getValidatorResults() {
- return validatorResults;
- }
-
- /**
- * Set results of the validation performed by the
- * <code>Validator</code>.
- * @param validatorResults results of validation
- */
- public void setValidatorResults(ValidatorResults validatorResults) {
- this.validatorResults = validatorResults;
- }
-
- /**
- * Returns a <code>Map</code> of values returned
- * from any validation that returns a value other than
- * <code>null</code> or <code>Boolean</code> with the
- * key the full property path of the field.
- * @return <code>Map</code> of non-null values
- */
- public Map getResultValueMap() {
- return (validatorResults != null ? validatorResults.getResultValueMap() : null);
- }
-
- /**
- * Gets page.
- * @return page number
- */
- public int getPage() {
- return page;
- }
-
- /**
- * Sets page.
- * @param page page number
- */
- public void setPage(int page) {
- this.page = page;
- }
-
-
- /**
- * Reset all properties to their default values.
- *
- * @param mapping The mapping used to select this instance
- * @param request The servlet request we are processing
- */
- public void reset(ActionMapping mapping, HttpServletRequest request) {
- super.reset(mapping, request);
- page = 0;
- validatorResults = null;
}
-
-
-
/**
* Used to indicate the current page of a multi-page form.
More information about the cvs
mailing list