美文网首页
Tomcat设置主页

Tomcat设置主页

作者: Pomelo的笔记本 | 来源:发表于2017-10-28 01:41 被阅读0次

修改$tomcat/conf/server.xml文件
在server.xml文件中,有一段如下:

<Engine name="Catalina" defaultHost="localhost">......
  <Host name="localhost"  appBase="webapps"  unpackWARs="true" autoDeploy="true">
      <Context path="" docBase="主页所在目录路径" debug="0" reloadable="true"/>
  </Host>
</Engine>

如,在<host></host>标签之间添加上:

<Context path="" docBase="\root\tomcat\webapps\myjsp" debug="0" reloadable="true" />

修改$tomcat/conf/web.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>index.html</welcome-file>之间添加上:

<welcome-file>a.jsp</welcome-file>

Tips:文本编辑器下命令模式输入 /welcome 可以查找到位置

相关文章

网友评论

      本文标题:Tomcat设置主页

      本文链接:https://www.haomeiwen.com/subject/cmdjpxtx.html