httpservletrequst专题

servlet的三个重要的类(httpServlet 、httpServletRequst、 httpServletResponse)

一、httpServlet  写一个servlet代码一般都是要继承httpServlet 这个类,然后重写里面的方法 但是它有一个特点,根据之前写的代码,我们发现好像没有写main方法也能正常执行。 原因是:这个代码不是直接运行的,而是放到tomcat上运行的 换句话说,tomcat里就有main方法 1.httpServlet的几个主要方法 init方法是初始化操作 serv