I have encountered this issue a couple of times, always found a way to code around but now I really need to ask:
Can struts create lists/arrays (or whatever collection) when e.g. using
public class MyAction extends ActionSupport {
public List getChoices() {
....
}
....
public List getPreSelectedChoices() {
// returns a list of Choice.getKey(), which is a String
....
}
}
public class Choice {
public String getKey() { ...}
public String getDisplayName() { ... }
....
}
The selected values are sent to
public void setMyChoice(String myChoice){
...
}
correct? There is no way something like
public void setMyChoice(String[] myChoice){
...
}
works in struts?
If not, whats the common way to get the values back from the String myChoice? Use Split on it?