Form values in the parameter map are always of type String[] even if they contain only one value. This is because you may return muliple values with the same name (ie checkboxs) from an html form.
You do not need to use an OnglList here. When you use an OgnlList it is prepopulated with objects so that you can set properties on those objects. In your example the List is populted with Strings (immutable) which are then replaced by the String[] value from the parameter map. You could instead extend List with a add(String) method which would use XWorks type conversion to use the first String in the array. John. ----- Original Message ----- From: "Jonas Eriksson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 05, 2003 9:13 PM Subject: [OS-webwork] OGNL list question again > Hi! > > I can not understand why I get arrays (instead of Strings) when OGNL > populates my list in my action! > > In action: > > // Use OgnlList so we don't get out of bounds > private List theList = new OgnlList(String.class) > > public List getList() { > return theList; > } > > In view: > > <input type="text" name="list[1]" size="2" maxlength="2"> > <input type="text" name="list[2]" size="2" maxlength="2"> > and so on... > > Then in my action, theList will contain an array of size 1 in position 1 > and 2. Of course I want the string object directly in theList. > > I'm using the latest from cvs. (ww2, xw) > > Thanks > Jonas > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Opensymphony-webwork mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork