I'm using Struts 2, and I have a number of fields on which I perform some basic validation. Upon submission everything goes to the MyClass-validations.xml and the fields fail/pass. When they pass everything is rosey, but when they fail I get exceptions. The root of this is that I have a list that is retrieved by another action on page load. What I need to know is - is there a way to get hang on to this request level list for reuse if validation fails? Thanks in advance.
FWIW, you could just have a getter in the action that returns the list and skip putting it in the request altogether.
That has the side benefit of taking non-validation stuff out of the validate() method.
Fletcher Munson
Ranch Hand
Joined: May 16, 2007
Posts: 31
posted
0
I'm entering transactions for an accounting system, and I need to retrieve the list based on the type of transaction. I use an initial action on page load to determine what the list will contain. I need to perform the same assessment during validation. If I just use a getter I didn't think the jsp would know about the type when it renders the page. Or am I wrong?
This brings me to my next question which I think should be a new topic.