From: "Caroline Jen" <[EMAIL PROTECTED]>
> I have two problems with the validation messages:
> First, "The first time" that the form is displayed (a
> blank form), all the validation warning messages are
> on the top of the web page.

This comes up repeatedly, please search the archives.

You either need to avoid validation the "first" time, or else turn it off
and call it manually when needed.  I leave it turned on, and do this:

   public ActionErrors validate( ActionMapping mapping, HttpServletRequest
request )
   {
      ActionErrors ae = new ActionErrors();
      /*
       *  only validate if the form has actually been POSTed.
       *  This keeps error messages from appearing when the
       *  form is displayed for the first time.
       */
      if ( request.getMethod().equals( "POST" ) ) {
                  return super.validate( mapping, request );
      } else {
         return null;
      }
   }

> Can anybody tell what went wrong?  Because validation
> warning messages are supposed to be shown "after" the
> form is submitted (if there are errors).

Step through the code in a debugger and it will become clear.  Every time a
request comes in, validate gets called (if you have it configured that way).
This happens *before* the form gets displayed.

-- 
Wendy Smoak


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to