You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Casey Forbes <cf...@kensfoods.com> on 2004/09/03 17:00:00 UTC

ValidatorResults are empty? (in Struts 1.2.2 with the new Commons Validator)

Hi all,

This is sort of a commons-validator question but I know that
there are some folks here that know all about the validator...

I just upgraded to Struts 1.2.2 from 1.1 and I broke all of my 
applications :(

It looks like ValidatorForm.getResultValueMap() will always return an 
empty map because Validator.validate() always returns an empty 
ValidatorResults object. (The last line of the validate method returns a 
brand new ValidatorResults object)

CVS tells me that this was changed in Validator.java rev 1.33 back in 
February so I guess that it is going to stay this way. I'm not sure what 
to do now because I have a dozen applications (and hundreds of forms) that 
were using the validator results to get the Integers, Dates, or whatever 
that the validator converted for me.

Will Struts 1.2.2 work properly with the commons-validator that
was packaged with Struts 1.1? Does anybody have any other ideas?
Am I missing something?

Thanks,
Casey



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


Re: ValidatorResults are empty? (in Struts 1.2.2 with the new Commons Validator)

Posted by Bill Siggelkow <bi...@bellsouth.net>.
Hmmm ... looking at the Validator.validate() method it seems it should 
only return an empty ValidatorResults if there is no Form configuration 
associated with the ValidatorForm object.

     public ValidatorResults validate() throws ValidatorException {
         Locale locale = (Locale) this.getParameterValue(LOCALE_PARAM);

         if (locale == null) {
             locale = Locale.getDefault();
         }

         this.setParameter(VALIDATOR_PARAM, this);

         Form form = this.resources.getForm(locale, this.formName);
         if (form != null) {
             this.setParameter(FORM_PARAM, this);
             return form.validate(
                 this.parameters,
                 this.resources.getValidatorActions(),
                 this.page);
         }

         return new ValidatorResults();
     }

I haven't debug to see if this is true so YMMV.

Bill Siggelkow


Casey Forbes wrote:
> Hi all,
> 
> This is sort of a commons-validator question but I know that
> there are some folks here that know all about the validator...
> 
> I just upgraded to Struts 1.2.2 from 1.1 and I broke all of my 
> applications :(
> 
> It looks like ValidatorForm.getResultValueMap() will always return an 
> empty map because Validator.validate() always returns an empty 
> ValidatorResults object. (The last line of the validate method returns a 
> brand new ValidatorResults object)
> 
> CVS tells me that this was changed in Validator.java rev 1.33 back in 
> February so I guess that it is going to stay this way. I'm not sure what 
> to do now because I have a dozen applications (and hundreds of forms) 
> that were using the validator results to get the Integers, Dates, or 
> whatever that the validator converted for me.
> 
> Will Struts 1.2.2 work properly with the commons-validator that
> was packaged with Struts 1.1? Does anybody have any other ideas?
> Am I missing something?
> 
> Thanks,
> Casey


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


Re: Still more / Re: ValidatorResults are empty? (in Struts 1.2.2 with the new Commons Validator)

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Casey,

Sorry about that, I submitted the patch that screwed up the results map.
I've just applied a change to FieldChecks that should resolve this. The code
freeze for the Struts 1.2.3 release is 6pm Pacific Time today - so it should
be available soon in that distro.

Niall

----- Original Message ----- 
From: "Casey Forbes" <cf...@kensfoods.com>
To: <us...@struts.apache.org>
Sent: Friday, September 03, 2004 4:44 PM
Subject: Still more / Re: ValidatorResults are empty? (in Struts 1.2.2 with
the new Commons Validator)


> Okay - I started tapping out this question too soon and jumped to the
> wrong conclusion.  My applications are still broken but it isn't the fault
> of commons-validator.
>
> It looks like the resolution to this bug is the thing that is hurting me:
> http://issues.apache.org/bugzilla/show_bug.cgi?id=26413
>
> Basically, boolean pass/fail results are now returned from the FieldCheck
> and stuffed into the validation result map instead of the converted values
> that I used to get in Struts 1.1.
>
> Shouldn't this be documented in the Release Notes?
>
> Casey
>
>
>
> On Fri, 3 Sep 2004, Casey Forbes wrote:
>
> > Hi all,
> >
> > This is sort of a commons-validator question but I know that
> > there are some folks here that know all about the validator...
> >
> > I just upgraded to Struts 1.2.2 from 1.1 and I broke all of my
applications
> > :(
> >
> > It looks like ValidatorForm.getResultValueMap() will always return an
empty
> > map because Validator.validate() always returns an empty
ValidatorResults
> > object. (The last line of the validate method returns a brand new
> > ValidatorResults object)
> >
> > CVS tells me that this was changed in Validator.java rev 1.33 back in
> > February so I guess that it is going to stay this way. I'm not sure what
to
> > do now because I have a dozen applications (and hundreds of forms) that
were
> > using the validator results to get the Integers, Dates, or whatever that
the
> > validator converted for me.
> >
> > Will Struts 1.2.2 work properly with the commons-validator that
> > was packaged with Struts 1.1? Does anybody have any other ideas?
> > Am I missing something?
> >
> > Thanks,
> > Casey
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>



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


Still more / Re: ValidatorResults are empty? (in Struts 1.2.2 with the new Commons Validator)

Posted by Casey Forbes <cf...@kensfoods.com>.
Okay - I started tapping out this question too soon and jumped to the 
wrong conclusion.  My applications are still broken but it isn't the fault 
of commons-validator.

It looks like the resolution to this bug is the thing that is hurting me:
http://issues.apache.org/bugzilla/show_bug.cgi?id=26413

Basically, boolean pass/fail results are now returned from the FieldCheck 
and stuffed into the validation result map instead of the converted values 
that I used to get in Struts 1.1.

Shouldn't this be documented in the Release Notes?

Casey



On Fri, 3 Sep 2004, Casey Forbes wrote:

> Hi all,
>
> This is sort of a commons-validator question but I know that
> there are some folks here that know all about the validator...
>
> I just upgraded to Struts 1.2.2 from 1.1 and I broke all of my applications 
> :(
>
> It looks like ValidatorForm.getResultValueMap() will always return an empty 
> map because Validator.validate() always returns an empty ValidatorResults 
> object. (The last line of the validate method returns a brand new 
> ValidatorResults object)
>
> CVS tells me that this was changed in Validator.java rev 1.33 back in 
> February so I guess that it is going to stay this way. I'm not sure what to 
> do now because I have a dozen applications (and hundreds of forms) that were 
> using the validator results to get the Integers, Dates, or whatever that the 
> validator converted for me.
>
> Will Struts 1.2.2 work properly with the commons-validator that
> was packaged with Struts 1.1? Does anybody have any other ideas?
> Am I missing something?
>
> Thanks,
> Casey
>
>
>

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


Sorry / Re: ValidatorResults are empty? (in Struts 1.2.2 with the new Commons Validator)

Posted by Casey Forbes <cf...@kensfoods.com>.
Agh. I'm blind.

Disregard my message and have a good weekend.

Casey


On Fri, 3 Sep 2004, Casey Forbes wrote:

> Hi all,
>
> This is sort of a commons-validator question but I know that
> there are some folks here that know all about the validator...
>
> I just upgraded to Struts 1.2.2 from 1.1 and I broke all of my applications 
> :(
>
> It looks like ValidatorForm.getResultValueMap() will always return an empty 
> map because Validator.validate() always returns an empty ValidatorResults 
> object. (The last line of the validate method returns a brand new 
> ValidatorResults object)
>
> CVS tells me that this was changed in Validator.java rev 1.33 back in 
> February so I guess that it is going to stay this way. I'm not sure what to 
> do now because I have a dozen applications (and hundreds of forms) that were 
> using the validator results to get the Integers, Dates, or whatever that the 
> validator converted for me.
>
> Will Struts 1.2.2 work properly with the commons-validator that
> was packaged with Struts 1.1? Does anybody have any other ideas?
> Am I missing something?
>
> Thanks,
> Casey
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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