html
<form method="post" action="testform1.do">
<input type="text" name="username">
<input type="text" name="userpwd">
<input type="submit" value="提交">
</form>
------------------------------------------
<form method="post" action="testform2.do">
<input type="text" name="username">
<input type="text" name="userpwd">
<input type="submit" value="提交">
</form>
------------------------------------------
<form method="post" action="testform3.do">
<input type="text" name="username">
<input type="text" name="userpwd">
<input type="submit" value="提交">
</form>
controller
@PostMapping("testform1.do")
public String testform1(String username, String userpwd){
return username + "----" + userpwd;
}
@PostMapping("testform2.do")
public String testform2(UserInfo userInfo){
return userInfo.toString();
}
@PostMapping("testform3.do")
public String testform3(HttpServletRequest request){
return request.toString();
}