Tomcat服务器"主页"修改为"自己项目的主页"

版权声明:本文为Niz原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_39403734/article/details/86495241

将"访问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了;

猜你喜欢

转载自blog.csdn.net/qq_39403734/article/details/86495241
今日推荐