Hello guys I need to pass a string array over to a setter that takes a Set. Not sure how to pass it over. Thanks
THis is my form:
public String[] getFields() { return fields; }
public void setFields(String[] s)
{
fields = s;
//System.out.println("form Array length " + s.length);
}
and here is the bean:
private Set<FieldBean> fields;
public void setFields( Collection<FieldBean> val )
{
t
if( fields == null ) fields = new HashSet<FieldBean>();
fields.addAll( val );
}
Action code:
ParameterBean paramBean = new ParameterBean();
form.getFields() y
paramBean.setFields(Arrays.asList(form.getFields())); //Need bean set here
got a message that stated: The method setFields(Collection) in the type ParameterBean is not applicable for the arguments (List)