tomcat中的web.xml和web项目中的web.xml
2016-01-25 22:32
441 查看
tomcat下conf下的web.xml里面的一部分
<!-- ==================== Default Welcome File List ===================== -->
<!-- When a request URI refers to a directory, the default servlet looks -->
<!-- for a "welcome file" within that directory and, if present, to the -->
<!-- corresponding resource URI for display. -->
<!-- If no welcome files are present, the default servlet either serves a -->
<!-- directory listing (see default servlet configuration on how to -->
<!-- customize) or returns a 404 status, depending on the value of the -->
<!-- listings setting. -->
<!-- -->
<!-- If you define welcome files in your own application's web.xml -->
<!-- deployment descriptor, that list *replaces* the list configured -->
<!-- here, so be sure to include any of the default values that you wish -->
<!-- to use within your application. -->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
<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>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
其中,load-on-startup表示启动时加载,其中的 <init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
true表示将向客户端一一展示WebRoot下面除了META-INF和WEB-INF的所有文件。false表示返回404错误页面。
JavaEE是一种规范,有很多实现,servlet只是其中一种。
<!-- ==================== Default Welcome File List ===================== -->
<!-- When a request URI refers to a directory, the default servlet looks -->
<!-- for a "welcome file" within that directory and, if present, to the -->
<!-- corresponding resource URI for display. -->
<!-- If no welcome files are present, the default servlet either serves a -->
<!-- directory listing (see default servlet configuration on how to -->
<!-- customize) or returns a 404 status, depending on the value of the -->
<!-- listings setting. -->
<!-- -->
<!-- If you define welcome files in your own application's web.xml -->
<!-- deployment descriptor, that list *replaces* the list configured -->
<!-- here, so be sure to include any of the default values that you wish -->
<!-- to use within your application. -->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
<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>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
其中,load-on-startup表示启动时加载,其中的 <init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
true表示将向客户端一一展示WebRoot下面除了META-INF和WEB-INF的所有文件。false表示返回404错误页面。
JavaEE是一种规范,有很多实现,servlet只是其中一种。
相关文章推荐
- eclipse 关于The APR based Apache Tomcat Native library警告
- Tomcat会话超时时怎样记录操作日志,满足安全审计要求
- nginx做了一层负载均衡代理,nginx转发请求给tomcat时,端口号已经丢失掉了
- Tomcat启动分析(Tomcat7.0)
- tomcat 两个端口部署应用
- java.lang.UnsatisfiedLinkError: D:\Tomcat\apache-tomcat-7.0.37\bin\tcnative-1.dll: Can't load AMD 6
- 运行tomcat7w.exe tomcat7.exe ,提示 指定的服务未安装 unable to open the service 'tomcat7'
- tomcat远程调试设置
- tomcat远程调试设置
- 运行tomcat7w.exe tomcat7.exe ,提示 指定的服务未安装 unable to open the service 'tomcat7'
- 【转】使用Eclipse远程调试发布在Tomcat上的Web应用
- 【转】使用Eclipse远程调试发布在Tomcat上的Web应用
- Tomcat Can't load AMD 64-bit .dll on a IA 32
- memerched+tomcat 缓存浏览器的session
- nginx+tomcat实现负载均衡
- c3p0、dbcp和proxool比较 据说TOMCAT 7之后的 JDBC 性能更好
- Tomcat安装配置
- Tomcat启动报Error listenerStart解决方法
- 关于通过nginx配置到apache-tomcat-7.0.67的端口的时候access中打印访问日志会一直输出nginx的地址而不是用户的真实地址
- 关于使用apache-tomcat-7.0.67中在apache-tomcat-7.0.67/log/catalina.out文件过大的解决方案