servlet需要实现接口 servletContextListener
ServletContext对象只能有一个,他继承了ServletContextListener接口。
在web.xml里面进行注册,也可以配置参数
<context-param>
<param-name>imooc</param-name>
<param-value>goods</param-value>
</context-param>
然后在监听器里面获取参数
`
ServletContextListener.getSevletContext().getInitParameter()
`
HttpSession对象可以有多个
启动顺序
会监听application和session以及request对象中属性的增添情况。