Greetings All, What I'm trying to accomplish is this. I want to have a listbox(listA) pass it's selected (multiple) values to a bean which in turn will create a dynamic list for the second listbox(listB). My setProperty pulls in the the values which is defined as a String array. The getProperty I have defined takes the array and concatenates the values and returns a single String. I referenced Frank's post ( http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=7&t=001041 ) but it doesn't cover multiple values.
However in doing this, my JSP reports that it "Can't find a method to write property 'area' in a bean of type 'PrefillFormView'". Do the values of the getter and setter need to be of the same type? I was able to workaround this by creating another getter method(getAreaOut) with a different name that does the conversion for me, instead of the original getter method(getArea). Is there a way to do this without using this workaround? Please keep in mind, I am attempting to do this without using any code in my JSPs... My bean... import java.sql.*; import java.net.*; public class PrefillFormView {
private String[] _prefillArea; private String[] _prefillAreaOut; public PrefillFormView() { _prefillArea = new String[] { "" }; }
public String[] getArea() { return _prefillArea; } public String getAreaOut() { StringBuffer list = new StringBuffer(); String[] myarray = _prefillArea;
if ( myarray != null ) { for (int i = 0; i < myarray.length; i++) { list.append( myarray[i] + "\n"); } } return list.toString();