如何修改tomcat的默认主页

ygc8163 2004-12-01 10:15:29
如何修改tomcat的默认主页
当我打开主页是能够进入我制作网页的 文件夹和我设置的主页如index.jsp
...全文
1031 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
wuxyu 2010-06-24
  • 打赏
  • 举报
回复
我也没有找到root.xml文件啊?
care81619 2004-12-13
  • 打赏
  • 举报
回复
晕,哪里又root。xml文件啊???
zql2002 2004-12-01
  • 打赏
  • 举报
回复
up
little06 2004-12-01
  • 打赏
  • 举报
回复
修改root.xml文件
指向你自己做的根目录
皮鲁 2004-12-01
  • 打赏
  • 举报
回复
改它的虚拟路径,在
%tomcat_home%\conf\Catalina\localhost\ROOT.xml
============================
<?xml version='1.0' encoding='utf-8'?>
<Context displayName="Welcome to Tomcat" docBase="X:/yourWebHome" path="/" workDir="work\Catalina\localhost\_">
</Context>

默认首页是index.html,index.htm,index.jsp 如果你的首页是index.jsp就不用改了,如果要改成其他,在你的WEB应用$web-inf$/web.xml的 <web-app>中加入
<web-app>
...
<welcome-file-list>
<welcome-file>yourIndex.xxx</welcome-file>
<welcome-file>yourIndex2.xxx</welcome-file>
</welcome-file-list>
</web-app>
duan123 2004-12-01
  • 打赏
  • 举报
回复
二楼正确
june37 2004-12-01
  • 打赏
  • 举报
回复
C:\tomcat\conf
下的 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>

以上这段改成你要登陆的页面就可以了!!!
bsh614 2004-12-01
  • 打赏
  • 举报
回复
修改conf文件夹下面的server.xml文件,使其指向你的文件夹就可以了
<Context path="" docBase="e:/examples" debug="0"
reloadable="true" crossContext="true">
mydeman 2004-12-01
  • 打赏
  • 举报
回复
在web.xml中设置默认的主页
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
ygc8163 2004-12-01
  • 打赏
  • 举报
回复
为什么我该完之后不行啊
<Context path="" docBase="c:\tomcat\webapps\myweb" debug="0"
reloadable="true" crossContext="true">

在修改以前我键入http://localhost:8080/myweb/
是可以执行的阿

67,515

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧