In fact, you can use any Objects as the ActionForm properties. If you want to store primitive data, you need to use the Wrapper classes. Of course, you need to have different *treatments* for each different objects.
Consider using Hashtable to store the checkbox values for dynamic checkboxes. For example, a
JSP allow users to add a certain number of files, which upload to the server. Since the number of uploads varies, we can use Hashtable to store the values.
But, you cannot simply specify the getter and setter of the Hashtable, as Struts is not setting the whole hashtable variables into it (unlike String and other Wrapper classes for primitive data types).
You need:
Then, Struts knows how to handle those checkboxes with Hashtable.
So do others.
Nick
[ May 20, 2004: Message edited by: Nicholas Cheung ]
SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)