You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by MichaƂ Postupalski <pl...@ncnet.pl> on 2003/01/25 00:17:12 UTC

Re: Validator validates too early (was RE: Validator won't valida te single required field)

On 1/24/2003 11:49 PM, Wendy Smoak wrote:
>       /*only validate if the form has actually been submitted.
>       We can tell this by checking to see if the Submit
>       button is in the request
>       */
>       
>       if (request.getParameter("Submit") != null) {
>          return super.validate( mapping, request );
>       } else {
>         return null;
>       }

I You are using POST method for sending request (and probably yes) I 
would exchange Your code for this one:

if (request.getMethod().equals("POST")) {
   return super.validate( mapping, request );
} else {
  return null;
}


plastic




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>