默认情况下我们输入
http://localhost:8080/是跳转到tomcat首页的,首页位置位于\webapps\ROOT下的index.html,有时候我们想输入
http://localhost:8080/直接调转到我们的某个项目的登录界面,那么要做如下两个配置文件的修改
1.修改conf/server.xml
搜索"appBase="webapps""字符,定位到host节点,在host节点之间最后面加上
<Context docBase="/data/webapp/tomcat/webapps/ask/" path="" reloadable="false" debug="0">
</Context>
docBase的是你项目放在linux系统的目录
2.修改tomcat的web.xml
在<welcome-file-list>加入你想要设置默认访问项目的login.jsp
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>