你的位置:首页 > Java教程

[Java教程]conf/web.xml


1.org.apache.catalina.servlets.DefaultServlet

 <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>  <!-- The mapping for the default servlet -->  <servlet-mapping>    <servlet-name>default</servlet-name>    <url-pattern>/</url-pattern>  </servlet-mapping>

首先所有的请求进入tomcat,都会流经servlet,如果没有匹配到任何应用指定的servlet,那么就会流到默认的servlet。默认的servlet是配置在/conf/web.