struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Francalanci" <lfrancala...@simtel.ie>
Subject R: R: request attributes and failed validation
Date Mon, 02 Feb 2004 11:18:04 GMT
I think that the form is added to the request before
the call to execute(..).
Are you sure that (request.getAttribute("myForm") != null)
is not true the first time you call the page?

> -----Messaggio originale-----
> Da: Ian Joyce [mailto:Ijoyce@aafp.org]
> Inviato: lunedi 2 febbraio 2004 13.09
> A: struts-user@jakarta.apache.org
> Oggetto: Re: R: request attributes and failed validation
> 
> 
> >>> lfrancalanci@simtel.ie 02/02/04 03:18 AM >>>
> > Using an Action as "input" sometimes takes more work.  Your 
> action should
> > know that it's only redisplaying a form and not reset all form 
> values (or
> > else the user will have to reinput everything instead of just 
> correct the
> > validation error).  
> 
> 
> How do you usually do this? Using an hidden parameter?
> 
> 
> That's one way to do it.  This is how I ended up doing it.
> 
> // Validation failed, don't reset the form.
> if (request.getAttribute("myForm") != null) {
>   return mapping.findForward("success");
> }
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> 

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


Mime
View raw message