摘要: 概述 与请求相关的监听器有三个:ServletRequestListener、ServletRequestAttributeListener与AsyncListener。第三个是在Servlet 3.0中新增的监听器。 ServletRequestListener ServletRequestLis 阅读全文
posted @ 2018-12-03 23:47 zhuangrunwei 阅读(290) 评论(0) 推荐(0) 编辑
摘要: 概述 与HttpSession相关的监听器有四个:分别是HttpSessionListener、HttpSessionAttributeListener、HttpSessionBindingListener与HttpSessionActivationListener。 HttpSessionList 阅读全文
posted @ 2018-12-03 20:59 zhuangrunwei 阅读(1028) 评论(0) 推荐(0) 编辑
摘要: 概述 与ServletContext相关的监听器有ServletContextListener与ServletContextAttributeListener。 ServletContextListener ServletContextListener是“生命周期监听器”,可以让我们知道Web应用程 阅读全文
posted @ 2018-12-03 20:05 zhuangrunwei 阅读(522) 评论(0) 推荐(0) 编辑
摘要: 生命周期监听器与属性改变监听器都必须使用@WebListener或在web.xml中声明,容器才会知道要加载、读取相关的监听器。 阅读全文
posted @ 2018-12-03 19:50 zhuangrunwei 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 概念 ServletContext本身的名称令人有点困惑,因为它以Servlet作为开头,容易被误认为仅是单一Servlet的代表对象。事实上,当整个Web应用程序加载Web容器之后,容器会生成一个ServletContext对象作为整个应用程序的代表。 1、setAttribute()、getAt 阅读全文
posted @ 2018-12-03 17:47 zhuangrunwei 阅读(187) 评论(0) 推荐(0) 编辑
摘要: GenericServlet实现了Servlet接口的Init()方法 GenericServlet主要目的,就是在容器调用init()方法时将传入的ServletConfig封装起来————赋值给成员变量。 GenericServlet在实现Servlet的init()方法时,也调用了另一个无参数 阅读全文
posted @ 2018-12-03 16:45 zhuangrunwei 阅读(221) 评论(0) 推荐(0) 编辑
摘要: ServletConfig ServletConfig是个别Servlet的设置信息对象。 使用注解设置个别Servlet的初始参数,可以在@WebServlet中使用@WebInitParam设置initParams属性。 在web.xml中设置个别Servlet的初始参数,可以在<servlet 阅读全文
posted @ 2018-12-03 14:34 zhuangrunwei 阅读(124) 评论(0) 推荐(0) 编辑
摘要: package javax.servlet; import java.io.IOException; public interface Servlet { void init(ServletConfig var1) throws ServletException; ServletConfig getServletConfig(); void service(Ser... 阅读全文
posted @ 2018-12-03 14:30 zhuangrunwei 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-12-03 14:13 zhuangrunwei 阅读(685) 评论(0) 推荐(1) 编辑