html - Handling multiple <input>s with the same name in spring-mvc -
please take @ codes below. 4 text boxes displayed.
if input "1" , "2" former text-boxes, these binded comma-separated "1,2" expected.
however, if input "2001/01/01" , "2001/01/02" in rest of two-boxes binded "2001/01/01". "2001/01/01" binded surprisingly. first parameter seems having priority bind.
i want know defined specifications(http or springmvc or ...?) in order understand , accurately. can me?
form public class sampleform { private string name; private date date; public date getdate() { return date; } public void setdate(date date) { this.date = date; } public string getname() { return name; } public void setname(string name) { this.name = name; } } jsp <form:form modelattribute="form" method="post"> <form:input path="name" /> <form:input path="name" /> <form:input path="date" /> <form:input path="date" /> <p> <input type="submit" name="register" value="register" /> </p> </form:form>
it's logical. multiple strings can represented 1 string
being comma-separated. multiple date
objects can't represented 1 date
object.
you can try using string[]
, date[]
instead.
Comments
Post a Comment