大多数情况下,我们是通过继承HttpServlet来开发我们自己的servlet, 我们主要实现doGet()和doPost()方法。
在默认情况下,是Get提交。
get提交和post提交的区别:
安全性
post方式更加安全,因为以get方式提交的数据会明文显示在地址栏中:如 http://localhost:8080/web1/myservlet?username=xiaoming&password=123
而post方式会把数据存在http请求的内容体中提交的内容数量上
get方式小于post方式从请求的响应上
服务器端会立即处理get请求,而post请求可能会形成一个队列