将"访问tomcat的主页"变为"访问自己的主页";
只需要修改在tomcat下的conf文件夹里面的web.xml和server.xml文件;
先说web.xml
修改文件底部的代码
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
修改为:
<welcome-file-list>
<welcome-file>访问路径.html</welcome-file>
<welcome-file>访问路径.htm</welcome-file>
<welcome-file>访问路径.jsp</welcome-file>
</welcome-file-list>
补充: 访问路径.html 可以是 AAA/BBB.html 也可以是CCC.html
再说server.xml
在
<Engine name="Catalina" defaultHost="localhost"></Engine >
里面的
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"></Host >
里面新增内容
<Context path="" docBase="项目名" debug="0" reloadable="true" />
补充: 只需要修改项目名称,其他复制过去就行;
然后重启Tomcat服务器就OK了;