新手对web.xml的描述

<!-- 这是网站欢迎页面列表:
1.当在浏览器输入服务器地址访问时,如果没有输入具体的资源文件路径,则会按照下表依次查找并执行;
注意:查找最上面的页面执行,后面的会被忽略
2.如有资源文件路径不匹配,且没有欢迎页面与之对应,则报404错误,找不到服务器资源
3.常见的服务器资源文件:jsp文件,servlet的url配置,html文件,css文件,js文件,img多媒体文件,其它格式的文件
4.网站的基本目录结构:
/网站根目录
-/css
-/js
-/img
-jsp和html文件
-/其它文件目录
-/WEB-INF - 这是网站配置信息的布置目录,它是以沙箱模式进行工作的,
目录中的内容不能直接在浏览器使用网址进行访问
-/web.xml -网站部署描述文件,用于配置jsp服务组件程序
-/lib -这是网站的类路径,用于存放打包jar文件的类,即放jar文件
-/classes -这是网站的类路径,用于存在编译后的class类文件,在src下编写的java代码,编译后存在的目录
- 这里也经常存放网站的其它配置文件

-->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>

<!-- 配置全局的错误提示页,当网站发生错误时,会根据错误码或错误类型跳转到对应的页面,显示错误码对应的页面内容 -->
<error-page>
<error-code>404</error-code>
<location>/404.html</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/500.html</location>
</error-page>

原文地址:https://www.cnblogs.com/meishibiexuejava/p/8370889.html