You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nathan Ewing <na...@yahoo.com> on 2003/07/02 19:39:07 UTC

More Validation Problems

Well I figured out why I was getting a validation error.  I was returning a
null error if there were no errors.

Unfortunately now I find my real problem.

My form shows correctly (more or less), but if I hit submit instead of just
popping back up with validation errors it goes to the Action class behind it. 
Shouldn't it by default show my form, then if I enter wrong data just show the
form again with the errors, and then if it passes with no errors it should go
to the action class for processing?

   Nathan



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


Re: More Validation Problems

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
wait til you graduate onto struts validator, you'll have a ball then ;)

Nathan Ewing wrote:
> Omg I figured it out :)
> 
> In my validation, to see if someone had filled in a required field I was
> checking to see if the field was null.  Because of this whenever the form
> displayed the bean would be created with null fields and errors would display. 
> Then when I hit submit it would make the blank field "" instead of null so I
> wouldn't get an error :)
> 
>    Nathan
> 
> 
> --- Nathan Ewing <na...@yahoo.com> wrote:
> 
>>Well I figured out why I was getting a validation error.  I was returning a
>>null error if there were no errors.
>>
>>Unfortunately now I find my real problem.
>>
>>My form shows correctly (more or less), but if I hit submit instead of just
>>popping back up with validation errors it goes to the Action class behind it.
>>
>>Shouldn't it by default show my form, then if I enter wrong data just show
>>the
>>form again with the errors, and then if it passes with no errors it should go
>>to the action class for processing?
>>
>>   Nathan
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 


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


Re: More Validation Problems

Posted by Nathan Ewing <na...@yahoo.com>.
Omg I figured it out :)

In my validation, to see if someone had filled in a required field I was
checking to see if the field was null.  Because of this whenever the form
displayed the bean would be created with null fields and errors would display. 
Then when I hit submit it would make the blank field "" instead of null so I
wouldn't get an error :)

   Nathan


--- Nathan Ewing <na...@yahoo.com> wrote:
> Well I figured out why I was getting a validation error.  I was returning a
> null error if there were no errors.
> 
> Unfortunately now I find my real problem.
> 
> My form shows correctly (more or less), but if I hit submit instead of just
> popping back up with validation errors it goes to the Action class behind it.
> 
> Shouldn't it by default show my form, then if I enter wrong data just show
> the
> form again with the errors, and then if it passes with no errors it should go
> to the action class for processing?
> 
>    Nathan
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


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