How do I mention scope for action class? I want put all the member variables for the particular myaction class into session.
Basically I am loosing all the values in the form if struts validation fails. Can someone help me to retain the form values if validation fails in struts2.
When validation fails, usually you are sent to the input page which is the page where you submitted the form. The values entered by the user are automatically filled in their respective fields. You don't need to do anything for that. Can you show us the code of your Action and input page...
And the configuration for the action(s) involved. The previous answer pretty much sums it up, though: if you redirect after the submit the form values will be lost. Actions are instantiated per-request.
Prav Chau
Ranch Hand
Joined: Jul 17, 2007
Posts: 58
posted
0
Action Mapping File: dealer_branchedit action populates the fields on edit page. when I try to save it calles "dealer_branchsave" action.
When validation fails it brings the edit page without existing values. All Drop down values and display only values are lost.