yutingliuyl

普通情况下,你的项目project中的web.xml文件里进行了这种配置

<welcome-file-list>
    <welcome-file>/index.jsp</welcome-file>
</welcome-file-list>

那么在浏览器地址栏输入http://localhost:8080/你的project名
就是默认訪问的project的WebRoot文件夹下的index.jsp文件
我想输入http://localhost:8080/ 也能訪问到index.jsp
除了web.xml文件要进行上面这种配置
还要在apache-tomcat-7.0.53\conf文件夹下的server.xml文件里进行例如以下配置
在</Host>节点的前面进行配置

<Context path="" docBase="E:\apache-tomcat-7.0.53\webapps\xxxx" debug="0" reloadable="true" crossContext="true" />

当中E:\apache-tomcat-7.0.53\webapps\xxxx为tomcatserver的webapps文件夹下的xxxxproject
(E:\apache-tomcat-7.0.53\webapps\xxxx这个路径你能够随便写,我这由于是myeclipse开发,而且直接公布到tomcatserver是这个文件夹,这样不用又一次拷贝project到你指定的文件夹)
假设你使用myeclipse开发,公布到tomcatserver上就是在webapps文件夹下
如今将你的的xxxxproject进行这种映射后
http://localhost:8080/ 这样訪问就能出现index.jsp页面了

注意:tomcatserver的webapps文件夹下,除了你的xxxxproject外,还有docs,examples。host-manager。manager,ROOT文件夹
尽量不要留有其它的文件夹
还有apache-tomcat-7.0.53\work\Catalina\localhost的文件夹下
除了你的xxxx文件夹,还有 -,docs,examples,host-manager。manager文件夹
尽量不要留有其它文件夹
这样可以提高server的启动速度

分类:

技术点:

相关文章:

  • 2021-11-03
  • 2021-10-18
  • 2021-12-29
  • 2021-11-03
  • 2021-11-03
  • 2021-11-23
  • 2021-10-09
  • 2021-05-01
猜你喜欢
  • 2022-01-09
  • 2021-11-03
  • 2021-11-14
  • 2021-11-03
  • 2021-11-19
  • 2021-08-05
  • 2021-11-03
相关资源
相似解决方案