对象
@RequestMapping("/Area")
public String login4(UserInfo info){
System.out.println(info.getUname()+" "+info.getBook().getBookname());
/* System.out.println(info.getUname()+" "+info.getBooks().get(0).getBookname());*/
return "/WEB-INF/delete.jsp";
}
<form action="${pageContext.request.contextPath}/Area" method="post">
用户名<input name="uname"/>
<input name="book.bookname"/>
<input type="submit"/>
</form>
集合
@RequestMapping("/Area")
public String login4(UserInfo info){
System.out.println(info.getUname()+" "+info.getBook().getBookname());
/* System.out.println(info.getUname()+" "+info.getBooks().get(0).getBookname());*/
return "/WEB-INF/delete.jsp";
}
<form action="${pageContext.request.contextPath}/Area" method="post">
用户名<input name="uname"/>
<%-- <input name="book.bookname"/>--%>
书名1<input name="books[0].bookname"/>
书名2<input name="books[1].bookname"/>
<input type="submit"/>
</form>