Below are snippets from my form.  I'm working on the first check of
several.  But have hit a wall with this problem.

The problem doesn't occur without the "errors.add("Test add", new
ActionError("errors.physical.takeover"));"
line of code.  With it the validate() method got called 163 times.

Thanks for the interest.

Bart

public class AuditAssignmentForm extends ValidatorActionForm {

      private boolean   physicalAudit           = false;
      private boolean   bookAudit               = false;
      private boolean   dracAudit               = false;
      private boolean   takeoverAudit           = false;

      /**
      * Constructor
      */
      public AuditAssignmentForm() {

            super();
      }

      public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {

            //
            // Validation plug-in is being used so must first call parent
validate method
            // before doing custom validations.
            //
            ActionErrors errors = super.validate(mapping, request);

            if(errors == null){
                  errors = new ActionErrors();
            }

            if(physicalAudit == true){
                  if(takeoverAudit == true){
                        errors.add("Test add", new ActionError(
"errors.physical.takeover"));
                  }
            }
            if(errors.isEmpty()){
                  return null;
            }else{
                  return errors;
            }
      }





                                                                           
             "Jim Barrows"                                                 
             <[EMAIL PROTECTED]                                             
             m>                                                         To 
                                       "Struts Users Mailing List"         
             08/18/2004 01:58          <[EMAIL PROTECTED]>            
             PM                                                         cc 
                                                                           
                                                                   Subject 
             Please respond to         RE: Validation plug-in & Websphere  
               "Struts Users           Studio 5.0.1                        
               Mailing List"                                               
             <[EMAIL PROTECTED]                                             
                  he.org>                                                  
                                                                           
                                                                           
                                                                           






> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 18, 2004 10:49 AM
> To: [EMAIL PROTECTED]
> Subject: Validation plug-in & Websphere Studio 5.0.1
>
>
>
>
>
>
> I'm new to Struts and couldn't find anything about this on
> the archive so
> please bear with me if I'm repeating a question.
>
> I'm developing a Struts 1.1 web app and trying to implement
> the validation
> plug-in.  Things went well as long as I was only using the
> validations that
> came with the plug-in.  When I try to add my own custom validation by
> overriding the validate() method of the form the server
> crashes with an
> IllegalStateException after dozens of loops in the validate()
> method.  The
> statement causing the problem is the errors.add() statement.
> Without it
> there is no problem.
>
> If anyone can help I'd be grateful.  I can provide more
> details from the
> log if needed.

How about some code?  Log is cool.... but code is better :)



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




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

Reply via email to