一般情况下,tomcat项目的默认页面为html、htm和jsp页面,但是我们的主页往往是动态的。比如.action .do 或者使用了其他插件,页面的后缀名不再仅仅是那3种了。
如果我们直接这样配置的话tomcat是不认可的。
其实解决的方法和简单,只要在项目根目录下建立一个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. -->