Say the following form (FORM A) -- maybe representative of a shopping
cart -- is generated dynamically:

FORM A:
-------------------------
| item a | qty __  |
-------------------------
| item b | qty __  |
-------------------------
| ...                   |
-------------------------
| item n | qty __  |
-------------------------

And, say the user submits the values "2,M, and 3" for items "a,b and n",
respectively.  Assuming "M" is an invalid "qty", the following form (FORM A,
again with error messages) gets generated:

FORM A:
ERROR:  Please fix errors marked, below.
-------------------------
| item a | qty  2  |
-------------------------
| item b | qty M  | ERROR: Invalid qty.
-------------------------
| ...                   |
-------------------------
| item n | qty  3  |
-------------------------

How do you recommend doing this with Struts?  What class(es) should be used?
How can errors be stored and retrieved dynamically?

Thanks in advance,

--Michael Marrotte

Reply via email to