java web servlet
404错误:是指没有路径
HttpServlet是一个抽象类, 不能直接使用,只能继承它。
HttpServlet中常用的方法有两个:
doGet
void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
当浏览器用GET方式访问时,该方法被调用。
doPost
void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
当浏览器用POST方式访问时,该方法被调用
doGet()和doPost()函数的两个参数为 HttpServletRequest(请求) 和 HttpServletResponse(响应) 对象。