title: How do I map one to many relationship on a JSP page and store them while submitting the page?
body: <p>Suppose, I have one class <code>Student</code> and another one is <code>Books</code>. The <code>Student</code> class having one to many relationship with <code>Books</code>.</p>
  
  <p>Now, I want to take the the data from user like student name, city etc and add the <code>Books</code> details like book name, author, price etc. on the same page. User can add multiple <code>Books</code> details(obviously). And then, I want to submit the page with all the nested object(books) data filled along with parent. How can I do that?</p>
  
  <p>You can take any other example instead of student and books as long as the requirement is satisfied.</p>
  
  <p>This is my JSP file:</p>
  
  <pre><code>// here student is a parent object and book is a child object having name,author etc details.
  
  &lt;body&gt;
    ${company} form
    &lt;form:form commandName="student" action="../homeController/getDetails"
        id="studentForm"&gt;
      Name: 
      &lt;form:input path="name" id="name" /&gt;
      City:
      &lt;form:input path="city" id="city" /&gt;
      &lt;form:input path="books.bookName" id="bookname"/&gt;
      &lt;form:input path="books.bookAuthor" id="bookauthor"/&gt;
      &lt;button type="submit" name="submit" style="width: 50px; height: 20px;"
          value="Submit"&gt;Submit&lt;/button&gt;
    &lt;/form:form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>If you can provide me a good link, that would also be a great help. </p>