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

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