The return value of springmvc is returned with void, input parameters. Bean and response,bean will not receive parameters. What is going on?

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 >

Feb.28,2021

the browser console opens to see if there is any data in your request.


what a strange way to use it. What does it mean that bean can't receive parameters? Isn't bean an input parameter? doesn't your write return data

?
Menu