Hi I keep getting the following error:
The method
setOfficeCode(String)
in the type UnitForm is not applicable for the arguments (List<String>
)
The java code I have is:
public static void main(String[] args)
{
UnitForm uform = (UnitForm) form;
List<String> lines = new ArrayList<String>();
lines.add("Once upon a midnight dreary");
lines.add("While I pondered weak and weary");
lines.add("Over many a quaint and curious volume of forgotten lore");
String[] linesArr = lines.toArray(new String[lines.size()]);
for (String line : linesArr)
{
System.out.println(line);
}
uform.setOfficeCode(lines);
}
I am trying to output what is contained in lines to a formbean in my jsp and if I convert setOfficeCode to a list what i see on my jsp is coming out with [] around it like [Over many a quaint and curious volume of forgotten lore, Hi, Bye] and I don't want the brackets to appear around the data on the jsp and i would like to break them up into separate lines instead of a whole string so that hi is on a new line and bye is on a new line etc.
Iterable
). You don't need to extract the array, first. – jpm Apr 5 at 19:33