第一种
前端:
<form action = "这里写跳转的页面的名字">
<input type = "text" name = "这里写的是跳转页面相关联,比如username"/>
<input type = "password" name = "这里写的是跳转页面相关联"/>
<input type = "submit" value = "这里写的是按钮的值、内容"/>
</form>
后端:
String name = request.getParameter("这里写的是与前端相关联,比如:username");
代码的目的:获取后台输入的数据。