actionform of multiple objects with validator
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   paul_white
Posted On:   Tuesday, July 1, 2003 06:45 AM

I have a requirement for an actionform to represent 1 or more objects and I wish to make use of the struts validator, ValidatorForm. Now to get my data into the actionform after submitting I guess I just need a number of methods such as public void setProperty1(String[] newProperty1) public void setProperty2(String[] newProperty2) public void setProperty3(String[] newProperty3) and I would also have the corresponding public String[] getProperty1(String[] newProperty1) public String[] getProperty2(String[] newProperty2) public String[] getProperty3(String[] newProperty3) First Problem -------------- when I deliver the actionform to the JSP how    More>>

I have a requirement for an actionform to represent 1 or more objects and I wish to make use of the struts validator, ValidatorForm.

Now to get my data into the actionform after submitting I guess I just need a number of methods such as

			
public void setProperty1(String[] newProperty1)
public void setProperty2(String[] newProperty2)
public void setProperty3(String[] newProperty3)

and I would also have the corresponding
			
public String[] getProperty1(String[] newProperty1)
public String[] getProperty2(String[] newProperty2)
public String[] getProperty3(String[] newProperty3)

First Problem
--------------
when I deliver the actionform to the JSP how can I iterate through the properties using the struts html taglib so that I get something like the following on the form when viewed in the browser (in example below we have 2 of the objects, i.e. size of each array in actionform is 2)
			








second problem
--------------
will the struts validator work for arrays (e.g. making property1 a required field)    <<Less
About | Sitemap | Contact