I'm looking for opinions on best practices here, I think. Here is what I want to do:
I have a jsp (struts) page that I want to display some information in a list. Currently I have that data in a Collection.
One method I used is to place the collection right on the request using request.setAttribute() (in the action class before the mapping.findForward() ) I can display the contents with a <c:forEach> without issue, but the problem occurs on validation. If the form fails the validation and the jsp page is redisplayed, the attribute I set is lost and the list is not redisplayed.
Next method was to store the Collection in the ActionForm and set the form onto the request with a request.setAttribute(). The validation fails with an "argument type mismatch" error. From what I've read, I think I understand that issue now.
So I'm wondering, how do most people handle Collections and ActionForms?
Start Free Trial