I have something exactly like this, and I get around it by setting the action's validate attribute to false for the "prepare" method, and true for the "submission" action... for example:
prepareEditUser: takes a user ID, loads all data up into request for JSP page to show, action does validation on the ID, form validate == false;
editUser: form validate == true, accepts all params from the edit page and verifies that they are sane.
So with the validate = false action, the form won't validate, you just have to move the check into the action then you can reuse the form.
Eric Fesler wrote:
Hi,
I'm currently working on an application with several pages having multiple combo-boxes.
The content of the combo-boxes is closely related to other components of the model. Therefore, I use a 'prepare' action to setup the model and put the combo-box collections in the request scope.
Unfortunately, this way of working is not compatible with the Struts validation process. Indeed, when the validation of the form failed, the request is forwarded back to the input page and the collections are not initialized.
A workaround would be to put the collections in the session scope (what I finally did) but at the end the session becomes full of garbage information. Another solution is to build the collection within the JSP page (maybe with custom tags) but this is against the separation of the view and the model.
I was wondering if anybody had already thought about an additional parameter linked to a struts-forward allowing page pre-processing. This parameter could point to a new kind of model action that will complete the model with information needed by the view any time the forward is activated.
Or... I'm missing something ...
How do you handle such a case?
Thanks,
--Eric
--------------------------------------------------------------------- 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]