热点推荐:ASP.Net | ADO.Net | VB.Net | Web服务器 | Access | MSSQL | MySQL | Oracle | .Net控件 | Win 9x | Win 2000 | Win 2003 | DOS | Unix | 注册表 | 应用其它 | 安装调试 | 基本操作 | 使用技巧 | 系统优化 |故障处理 | 个性风格 | 病毒安全 | 专杀工具
您现在的位置: 中华IT技术网 >> FAQ >> Linux >> Apache >> 正文
全文
怎么改变tomcat服务器的默认页啊?
作者:Nana    文章来源:Web    更新时间:2007-6-9

做了一个网站,用tomcat做服务器,想用一个自己定义的页面作默认主页,应该怎么设置啊?高手请指教!
---------------------------------------------------------------
在Tomcat 4.1\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>

Tomcat是按照设置的顺序找的,先找index.html,若没有,再找index.htm,若还没有,再找index.jsp,以下同理

如果想设置自己的默认页,如main.jsp,把它加入welcom-file-list中即可,如:
   <welcome-file-list>
        <welcome-file>main.jsp</welcome-file>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
这样当你打/时,默认的页面就是main.jsp了。

相关文章
最新更新
编辑推荐
热门图片
频道大全
文章阅读排行
周排行
月排行