The reset method is called, and an error occurs during it. But Struts
doesn't seem to be aware of this error.

Sylvie.

> -----Message d'origine-----
> De : Arnaud HERITIER [mailto:aheritier@;sopragroup.com]
> Envoyé : lundi 4 novembre 2002 15:21
> À : 'Struts Users Mailing List'
> Objet : RE: RE : RE : How to display an error from reset method
> (ActionForm) ?
> 
> Did you verify that the reset method is called ???
> I think that this method is not called the first time you access to
the
> form.
> 
> Arnaud
> 
> > -----Message d'origine-----
> > De : PALLUEL Sylvie [mailto:sylvie.palluel@;cnamts.fr]
> > Envoyé : lundi 4 novembre 2002 15:10
> > À : 'Struts Users Mailing List'; [EMAIL PROTECTED]
> > Objet : RE : RE : How to display an error from reset method
> > (ActionForm)
> > ?
> >
> >
> > We tried it, but with no more success.
> >
> > Sylvie.
> >
> > > -----Message d'origine-----
> > > De : Arnaud HERITIER [mailto:aheritier@;sopragroup.com]
> > > Envoyé : lundi 4 novembre 2002 14:46
> > > À : 'Struts Users Mailing List'
> > > Objet : RE: RE : How to display an error from reset method
> > (ActionForm) ?
> > >
> > > Ooops this is :
> > >
> > > request.setAttribute(Action.ERROR_KEY,errors);
> > >
> > > because your in an actionForm.
> > >
> > > Arnaud
> > >
> > > > -----Message d'origine-----
> > > > De : PALLUEL Sylvie [mailto:sylvie.palluel@;cnamts.fr]
> > > > Envoyé : lundi 4 novembre 2002 14:28
> > > > À : 'Struts Users Mailing List'; [EMAIL PROTECTED]
> > > > Objet : RE : How to display an error from reset method
> > (ActionForm)
> > ?
> > > >
> > > >
> > > > Hello,
> > > >
> > > > The problem is that the reset method doesn't return
ActionErrors.
> > > >
> > > > Sylvie.
> > > >
> > > > > -----Message d'origine-----
> > > > > De : Arnaud HERITIER [mailto:aheritier@;sopragroup.com]
> > > > > Envoyé : lundi 4 novembre 2002 14:11
> > > > > À : 'Struts Users Mailing List'
> > > > > Objet : RE: How to display an error from reset method
> > (ActionForm)
> > ?
> > > > >
> > > > > You can do it as you did it in the validate method. For
> > exemple :
> > > > >
> > > > >  ActionErrors errors = new ActionErrors();
> > > > >
> > > > >  if( dateFrom!=null &&
> > > > >   !dateFrom.trim().equals("") &&
> > > > >   !isValideDate(dateFrom)
> > > > >   )
> > > > >   errors.add(Constants.FROM_FIELD_ERROR, new
> > > > > ActionError("error.dateformat"));
> > > > >  if( dateTo!=null &&
> > > > >   !dateTo.trim().equals("") &&
> > > > >   !isValideDate(dateTo)
> > > > >   )
> > > > >   errors.add(Constants.TO_FIELD_ERROR, new
> > > > > ActionError("error.dateformat"));
> > > > >  if(ddelai!=null && !ddelai.trim().equals("")){
> > > > >   try{
> > > > >   int value = Integer.parseInt(ddelai);
> > > > >   if(udelai.equals(Constants.LIST_DEFAULT_VALUE)){
> > > > >    errors.add(Constants.DELAI_FIELD_ERROR, new
> > > > > ActionError("error.unitedelai.missing"));
> > > > >   }
> > > > >   if(value<=0)
> > > > >    errors.add(Constants.DELAI_FIELD_ERROR, new
> > > > > ActionError("error.integerformat"));
> > > > >   }catch(NumberFormatException nfe){
> > > > >   errors.add(Constants.DELAI_FIELD_ERROR, new
> > > > > ActionError("error.integerformat"));
> > > > >   }
> > > > >  }
> > > > >
> > > > >  return errors;
> > > > >
> > > > > Arno.
> > > > >   -----Message d'origine-----
> > > > >   De : PALLUEL Sylvie [mailto:sylvie.palluel@;cnamts.fr]
> > > > >   Envoye : lundi 4 novembre 2002 14:02
> > > > >   A : [EMAIL PROTECTED]
> > > > >   Objet : How to display an error from reset method
> > (ActionForm) ?
> > > > >
> > > > >
> > > > >   Hello,
> > > > >
> > > > >
> > > > >
> > > > >   I'm using the reset method in a class which inherits from
> > > > ActionForm
> > > > to
> > > > > initialize my form from database.
> > > > >
> > > > >
> > > > >
> > > > >   This method can fail and generate an error that I want to
> > display
> > > > using
> > > > > ActionErrors.
> > > > >
> > > > >   How can I do this ?
> > > > >
> > > > >
> > > > >
> > > > >   Thanks for your help.
> > > > >
> > > > >
> > > > >
> > > > >   Sylvie.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> >
**********************************************************************
> > > > >   This email and any files transmitted with it are
confidential
> > and
> > > > >   intended solely for the use of the individual or entity
> > > > to whom they
> > > > >   are addressed. If you have received this email in error
please
> > > > notify
> > > > >   the system manager.
> > > > >
> > > > >   This footnote also confirms that this email message has been
> > swept
> > > > by
> > > > >   MIMEsweeper for the presence of computer viruses.
> > > > >
> > > > >   www.mimesweeper.com
> > > > >
> > > >
> >
**********************************************************************
> > > >
> > > >
> > > >
> > > >
> >
**********************************************************************
> > > > This email and any files transmitted with it are confidential
and
> > > > intended solely for the use of the individual or entity
> > to whom they
> > > > are addressed. If you have received this email in error please
> > notify
> > > > the system manager.
> > > >
> > > > This footnote also confirms that this email message has been
swept
> > by
> > > > MIMEsweeper for the presence of computer viruses.
> > > >
> > > > www.mimesweeper.com
> > > >
> >
**********************************************************************
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > > <mailto:struts-user-unsubscribe@;jakarta.apache.org>
> > > > For additional commands, e-mail:
> > > > <mailto:struts-user-help@;jakarta.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:   <mailto:struts-user-
> > > [EMAIL PROTECTED]>
> > > For additional commands, e-mail: <mailto:struts-user-
> > > [EMAIL PROTECTED]>
> >
> >
> >
> >
> >
**********************************************************************
> > This email and any files transmitted with it are confidential and
> > intended solely for the use of the individual or entity to whom they
> > are addressed. If you have received this email in error please
notify
> > the system manager.
> >
> > This footnote also confirms that this email message has been swept
by
> > MIMEsweeper for the presence of computer viruses.
> >
> > www.mimesweeper.com
> >
**********************************************************************
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:struts-user-unsubscribe@;jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:struts-user-help@;jakarta.apache.org>
> >
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:struts-user-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:struts-user-
> [EMAIL PROTECTED]>




**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

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

Reply via email to