Here's a problem I've come across a couple of times and the solution I have
feels clunky so I thought I'd throw it out to see if anyone has any better
ideas;
 
I have a form which has a s:select populated from a Map of objects which
come from a database, at the moment I'm doing the following;
 
1) Action A gets the list from the database
2) A .JSP displays the form with the s:select and submits to Action B
3) Action B processes the form.
 
This is looks neat until you look at the situation when an error occurs. 
 
In order to ensure that the s:select is correctly filled the error result
has to send the browser back to Action A, which is being done as a redirect.
The problem with this is that all actionMessages and actionErrors get lost
during the redirect, and thus the user can't see what was wrong. To get
around this I use the store interceptor, but this causes problems if
validation is turned on (it will bounce the user to the error result of
Action A if an errorMessage is present - see
https://issues.apache.org/struts/browse/WW-1963 for the bug report).
 
So I end up with the validation interceptor turned off and having to hand
code some validation, and the store interceptor turned on for several
actions.
 
So has anyone found a better way of handling the "populate list -> show list
-> handle errors" situation?

Reply via email to