• web.xml


    在Tomcat/conf下有一个web.xml文件,当Tomcat中所有web应用实例化时都会读取该配置文件,然后读取每个web应用自己的配置文件(/WEB-INF/web.xml)。

    conf/web.xml作出以下配置:

    //处理未映射到其他servlet的请求
        <servlet>
            <servlet-name>default</servlet-name>
            <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
            <init-param>
                <param-name>debug</param-name>
                <param-value>0</param-value>
            </init-param>
            <init-param>
                <param-name>listings</param-name>
                <param-value>false</param-value>
            </init-param>
            <load-on-startup>1</load-on-startup>
        </servlet>
    //jsp页面编译和执行servlet
        <servlet>
            <servlet-name>jsp</servlet-name>
            <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
            <init-param>
                <param-name>fork</param-name>
                <param-value>false</param-value>
            </init-param>
            <init-param>
                <param-name>xpoweredBy</param-name>
                <param-value>false</param-value>
            </init-param>
            <load-on-startup>3</load-on-startup>
        </servlet>
    //映射关系
        <!-- The mapping for the default servlet -->
        <servlet-mapping>
            <servlet-name>default</servlet-name>
            <url-pattern>/</url-pattern>
        </servlet-mapping>
    
        <!-- The mappings for the JSP servlet -->
        <servlet-mapping>
            <servlet-name>jsp</servlet-name>
            <url-pattern>*.jsp</url-pattern>
            <url-pattern>*.jspx</url-pattern>
        </servlet-mapping>
    
    //会话设置
        <session-config>
            <session-timeout>30</session-timeout>
        </session-config>
    //MIME类型映射
        <mime-mapping>
            <extension>123</extension>
            <mime-type>application/vnd.lotus-1-2-3</mime-type>
        </mime-mapping>
        <mime-mapping>
            <extension>3dml</extension>
            <mime-type>text/vnd.in3d.3dml</mime-type>
        </mime-mapping>
        <mime-mapping>
            <extension>3ds</extension>
            <mime-type>image/x-3ds</mime-type>
        </mime-mapping>
        <mime-mapping>
            <extension>3g2</extension>
            <mime-type>video/3gpp2</mime-type>
        </mime-mapping>
    ...
    ...
    ...
  • 相关阅读:
    水晶报表显示到aspx页面中
    Python 2.7获取网站源代码的几种方式_20160924
    Seal Report_20160923
    MySQL交叉表处理_20160923
    MySQL日期处理函数_20160922
    MySQL文本处理函数2_20160921
    kettle及数据库导数_20160920
    MySQL常用的数据类型及函数_20160920
    MySQL记录_20160919
    [vuex]
  • 原文地址:https://www.cnblogs.com/wuchaodzxx/p/5988416.html
Copyright © 2020-2023  润新知