如何修改TOMCAT的默认主页为你自己项目的主页

来源:互联网 发布:地板污染知乎 编辑:程序博客网 时间:2024/05/17 05:00
启动tomcat之后,在猫页上有这么一段话: As you may have guessed by now, this is the default Tomcat home page. It can be found on the local filesystem at:
$CATALINA_HOME/webapps/ROOT/index.html
这就说明,无论你怎么折腾你自己的web.xml文件,对不起,tomcat只认它自己的web.xml定义的welcome页面。 而<welcome-file-list>标签上的这段注释:
<!-- If you define welcome files in your own application's web.xml        -->
<!-- deployment descriptor, that list *replaces* the list configured      -->
<!-- here, so be sure that you include any of the default values that     -->
<!-- you wish to include.-->
修改过程1.不要碰conf目录下的那个web.xml文件,让它老死在那里吧。 2.把原来的ROOT目录清空,里面什么都不要留。删掉或者改名随便你怎么弄都成。只要清空就好。 3.发布你自己的项目到ROOT目录下,用war包发布或者用直接拷贝的都一个效果。保证index.html/index.htm/index.jsp其中一个存在于ROOT目录下。 4.删除%CATALINA%/work目录下的一切。我就是没有清理这个目录,导致http://localhost:8080永远都是那只猫~~~~郁闷 5.通知服务商重起tomcat。
0 0
原创粉丝点击