I don't understand why it does not work.
It crashes only when the validate method is called and must return an error.
Is sqlQuery begins with "select" it works fine and i got to the result page.
Do i need to write a jsp page in case of error? (i already have one where i
forward to when an exception is called in my Action class)
-----Message d'origine-----
De: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Date: lundi 6 ao�t 2001 18:35
�: '[EMAIL PROTECTED]'
Objet: Re: Validation a form
On Mon, 6 Aug 2001, DUPRAT Alexandre wrote:
> hi,
>
> How can i validate a form?
> I tried :
> public ActionErrors validate(ActionMapping mapping, HttpServletRequest
req)
> {
> ActionErrors errors= new ActionErrors();
> if(! getSqlQuery().startsWith("select")){
> ActionError error = new ActionError("error.requete");
> errors.add("sqlQuery", error);
> }
> return errors;
> }
>
> it works when there is no error but not when i've one....
> Is there somebody with an idea?
>
The above code looks OK -- what about it doesn't work?
Note that you *must* specify an input attribute on your <Action>, so that
Struts knows where to send the user back to.
> Alexandre Duprat
> SOPRA. Direction France Sud. Bordeaux
> [EMAIL PROTECTED]
>
Craig McClanahan
+----------------------------------------------------------------+
| Ce courrier ainsi que les fichiers joints sont confidentiels. |
| Si vous avez recu ce courrier par erreur, veuillez en informer |
| l'administrateur du systeme : [EMAIL PROTECTED] |
| --------- |
| Ce message confirme que le courrier a passe le controle |
| antivirus du relais de messagerie Internet avec succes. |
+----------------------------------------------------------------+