<form action="BaseServlet?method=addStu" method="get">
<input type="text" name="username">
<input type="submit" value="提交">
</form>
如果直接点击提交
http://localhost:8080/WebProject/BaseServlet?username=
此时action上的?method=addStu被过滤掉
解决:
1、在form表单添加一个隐藏字段 method
<form action="BaseServlet" method="get">
<input type="hidden" name="method" value="addStu">
<input type="text" name="username">
<input type="submit" value="提交">
</form>
2、method使用post