Controller Code
@ RequestMapping (value= "/ testList.action")
public void insertList(Items item,HttpServletResponse resp) throws IOException{
System.out.println(item.getName());
System.out.println(item.getAddress());
resp.getWriter().write("hello");
}
syso when the data is null, the test will resp.getWriter (). Write ("hello"); remove the data, this is why?
Front desk:
< form id= "itemForm" action= "${pageContext.request.contextPath} / testList.action" method= "post" >
<input type="text" name="name"/>
<input type="text" name="address"/>
<input type="submit" value=""/>
< / form >