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>
本文介绍如何通过修改Tomcat的server.xml和web.xml文件来指定默认加载的项目及登录页面,实现输入根路径时直接访问特定项目的登录界面。

3585

被折叠的 条评论
为什么被折叠?



