struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Markert <dirk.mark...@dr-markert.de>
Subject Re: Please Help: ActionForm Re-Population
Date Mon, 14 Jul 2003 15:39:47 GMT
Hello Aaron,

  

***************************************************************

AL> I am on the last leg of a web application, and I've run into problems 
AL> adding validation to the mix.

AL> I have an "edit" Action that retrieves a database record, a list of 
AL> drop-down options, and then populates the "editor" ActionForm. Works 
AL> great, and I LOVE STRUTS!

AL> Now I've implemented validation (through the Validator Framework, but I 
AL> think my problem is with validate() in general).

AL> After the user clicks submit, their post is sent to my "update" action.

AL> If they do not break any validation rules, all goes well. The problem 
AL> occurs when a validation rule is broken.... They are returned to the 
AL> form... but the drop-downs (which are populated in the "edit" Action) 
AL> are empty. I have set breakpoints in the code... and I see that the page 
AL> neither my "edit" Action code (the part where the drop-down data is 
AL> retrieved), nor my "update" Action code is actually running.

AL> Question.... between pressing submit and returning the "edit" JSP with a 
AL> populated ActionErrors object. Where is "validate()" actually called?

After the RequestProcessor has populated your action form, validate is
called. This happens before your action is called.

AL> Where can I insert code to populate a drop-down with a set of values so 
AL> that it will appear both when the form is presented the first time, and 
AL> after a validation error?

You have at least 2 choices.

1) You can put your drop-down values into session scope.

2) You can set the input attribute of your action mapping to your edit
action.

AL> Thank you for your help,
AL> Aaron Longwell


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



Regards,
Dirk

+------- Quality leads ---------------------------------------+
| Dirk Markert                     dirk.markert@dr-markert.de |
| Dr. Markert Softwaretechnik AG                              |
| Joseph-von-Fraunhofer-Str. 20                               |
| 44227 Dortmund                                              |
+---------------------------------->>>>>>> to success! <<<<<<-+



---------------------------------------------------------------------
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