如果我们直接这样配置的话tomcat是不认可的。
<welcome-file-list> <welcome-file>index.action</welcome-file> </welcome-file-list>
其实解决的方法和简单,只要在项目跟目录下建立一个index.action的空文件就ok了。
根据是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 file -->
<!-- is present, the default servlet either serves a directory listing, -->
<!-- or returns a 404 status, depending on how it is configured. -->
<!-- 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 file -->
<!-- is present, the default servlet either serves a directory listing, -->
<!-- or returns a 404 status, depending on how it is configured. -->