<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">

<!--全局容器存贮的数据key-value结构 -->
    <context-param>
        <param-name>key1</param-name>
        <param-value>SZXS</param-value>
    </context-param>

    <context-param>
        <param-name>key2</param-name>
        <param-value>ITSang</param-value>
    </context-param>



    <servlet>
        <servlet-name>hlloworld</servlet-name>
        <servlet-class>com.itsang.HelloWorld</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>hlloworld</servlet-name>
        <url-pattern>/helloworld.do</url-pattern>
    </servlet-mapping>


    <servlet>
        <servlet-name>getRequestInfoServlet</servlet-name>
        <servlet-class>com.itsang.GetRequestInfoServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>getRequestInfoServlet</servlet-name>
        <url-pattern>/getRequestInfo.do</url-pattern>
    </servlet-mapping>


    <servlet>
        <servlet-name>GetRequestDataServlet</servlet-name>
        <servlet-class>com.itsang.GetRequestDataServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>GetRequestDataServlet</servlet-name>
        <url-pattern>/getRequestData.do</url-pattern>
    </servlet-mapping>


    <servlet>
        <servlet-name>GetRequestHeaderServlet</servlet-name>
        <servlet-class>com.itsang.GetRequestHeaderServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>GetRequestHeaderServlet</servlet-name>
        <url-pattern>/getRequestHeaderServlet.do</url-pattern>
    </servlet-mapping>



    <servlet>
        <servlet-name>LanguageExampleServlet</servlet-name>
        <servlet-class>com.itsang.LanguageExampleServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>LanguageExampleServlet</servlet-name>
        <url-pattern>/languageExample.do</url-pattern>
    </servlet-mapping>



    <servlet>
        <servlet-name>ResponseCharacterServlet</servlet-name>
        <servlet-class>com.itsang.ResponseCharacterServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>ResponseCharacterServlet</servlet-name>
        <url-pattern>/responseCharacterServlet.do</url-pattern>
    </servlet-mapping>



    <servlet>
        <servlet-name>ResponseByteServlet</servlet-name>
        <servlet-class>com.itsang.ResponseByteServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>ResponseByteServlet</servlet-name>
        <url-pattern>/responseByteServlet.do</url-pattern>
    </servlet-mapping>



    <servlet>
        <servlet-name>RedirectServlet</servlet-name>
        <servlet-class>com.itsang.RedirectServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>RedirectServlet</servlet-name>
        <url-pattern>/redirect.do</url-pattern>
    </servlet-mapping>


    <servlet>
        <servlet-name>FileDownServlet</servlet-name>
        <servlet-class>com.itsang.FileDownServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>FileDownServlet</servlet-name>
        <url-pattern>/fileDown.do</url-pattern>
    </servlet-mapping>




    <servlet>
        <servlet-name>GetBaseInfoServlet</servlet-name>
        <servlet-class>com.itsang.GetBaseInfoServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>GetBaseInfoServlet</servlet-name>
        <url-pattern>/getBaseInfo.do</url-pattern>
    </servlet-mapping>




    <servlet>
        <servlet-name>ContextReadInfoServlst</servlet-name>
        <servlet-class>com.itsang.ContextReadInfoServlst</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>ContextReadInfoServlst</servlet-name>
        <url-pattern>/contextReadInfo.do</url-pattern>
    </servlet-mapping>




    <servlet>
        <servlet-name>globalContextServlet</servlet-name>
        <servlet-class>com.itsang.GlobalContextServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>globalContextServlet</servlet-name>
        <url-pattern>/global.do</url-pattern>
    </servlet-mapping>




    <servlet>
        <servlet-name>getConfigServlet</servlet-name>
        <servlet-class>com.itsang.GetConfigServlet</servlet-class>
        <init-param>
            <param-name>key1</param-name>
            <param-value>SZXS</param-value>
        </init-param>
        <init-param>
            <param-name>key2</param-name>
            <param-value>ITSang</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>getConfigServlet</servlet-name>
        <url-pattern>/getConfig.do</url-pattern>
    </servlet-mapping>




    <servlet>
        <servlet-name>createCookieServlet</servlet-name>
        <servlet-class>com.itsang.CreateCookieServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>createCookieServlet</servlet-name>
        <url-pattern>/cookie.do</url-pattern>
    </servlet-mapping>



    <servlet>
        <servlet-name>getCookieDataServlet</servlet-name>
        <servlet-class>com.itsang.GetCookieDataServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>getCookieDataServlet</servlet-name>
        <url-pattern>/getCookie.do</url-pattern>
    </servlet-mapping>





    <servlet>
        <servlet-name>welcomeServlet</servlet-name>
        <servlet-class>com.itsang.WelcomeServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>welcomeServlet</servlet-name>
        <url-pattern>/welcome.do</url-pattern>
    </servlet-mapping>





    <servlet>
        <servlet-name>createHttpSessionServlet</servlet-name>
        <servlet-class>com.itsang.CreateHttpSessionServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>createHttpSessionServlet</servlet-name>
        <url-pattern>/createSession.do</url-pattern>
    </servlet-mapping>


    <servlet>
        <servlet-name>getHttpSessionDataServlett</servlet-name>
        <servlet-class>com.itsang.GetHttpSessionDataServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>getHttpSessionDataServlett</servlet-name>
        <url-pattern>/getSessionData.do</url-pattern>
    </servlet-mapping>
<!--   session-config  session-timeout  设置session对象自动销毁的时间 单位为分钟 -->
    <session-config>
        <session-timeout>1</session-timeout>
    </session-config>


    <servlet>
        <servlet-name>welcomeSessionServlet</servlet-name>
        <servlet-class>com.itsang.WelcomeSessionServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>welcomeSessionServlet</servlet-name>
        <url-pattern>/welcomeSession.do</url-pattern>
    </servlet-mapping>





    <servlet>
        <servlet-name>autoStarServlet</servlet-name>
        <servlet-class>com.itsang.AutoStarServlet</servlet-class>
        <init-param>
            <param-name>path</param-name>
            <param-value>image</param-value>
        </init-param>
        <!--自启动 值的大小决定启动的顺序 -->
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>autoStarServlet</servlet-name>
        <url-pattern>/autoStarServlet.do</url-pattern>
    </servlet-mapping>





    <servlet>
        <servlet-name>threadSafeServlet</servlet-name>
        <servlet-class>com.itsang.ThreadSafeServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>threadSafeServlet</servlet-name>
        <url-pattern>/threadSafe.do</url-pattern>
    </servlet-mapping>


    
    <filter>
        <filter-name>firstFilter</filter-name>
        <filter-class>com.itsang.filter.FirstFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>firstFilter</filter-name>
        <url-pattern>/suibian/*</url-pattern>
    </filter-mapping>


    <filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>com.itsang.filter.EncodingFilter</filter-class>
        <init-param>
            <param-name>code</param-name>
            <param-value>utf-8</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>


<!--    <listener>-->
<!--        <listener-class>com.itsang.listener.ServletContextLifecycleListener</listener-class>-->
<!--    </listener>-->

    <listener>
        <listener-class>com.itsang.listener.ServletContextAttrListener</listener-class>
    </listener>

<listener>
    <listener-class>com.itsang.listener.HttpSessionLifecycleListener</listener-class>
</listener>
    <listener>
        <listener-class>com.itsang.listener.HttpSessionAttrListener</listener-class>
    </listener>


    <listener>
        <listener-class>com.itsang.listener.HttpServletRequestLifecycleListener</listener-class>
    </listener>
    <listener>
        <listener-class>com.itsang.listener.HttpServletRequestAttrListener</listener-class>
    </listener>
</web-app>