※ 引述《k80097 ()》之銘言:
: 大家好
: 想請問在spring mvc裡
: Form summit input text
: 如何跳脫","符號而不會轉換成 array 呢?
: 謝謝
controller:
@RequestMapping(value = "/test")
public String test(@ModelAttribute TestObject o){
}
public class TestObject {
private Test[] tests;
//getter tests
//setter tests
}
public class Test {
private String[] stringArray;
//getter stringArray
//setter stringArray
}
JSP:
<input type="text" name="tests[0].stringArray" />
輸入值為: a,b,c
controller 接到就直接轉array了