I've searched the form and haven't found an answer to this question.
Let's say that a SimpleFormController receives a POST that looks like this:
foo=value1
bar=value2
bar=value3
bar=value4
I have a command class that looks like this:
Ignore any syntax errors in that code, I just typed it in by hand as an example.Code:public class MyCommand { private String[] foo; private String[] bar; public void setFoo(String[] foo) { this.foo = foo; } public String[] getFoo() { return foo; } public void setBar(String[] bar) { this.bar = bar; } public String[] getBar() { return bar; } }
The question is, how do I get value2, value3, and value4 to appear as elements of the array bar[] in my code? Right now, binding assigns "value1" to "foo" (correct) and "value2" to "bar". Even more oddly, if I had:
bar=new york, ny
bar=value3
bar=value4
In my command object, I wind up with "bar" containing two elements, "new york" and "ny".
What am I missing?


Reply With Quote