怎么改变tomcat服务器的默认页啊?

做了一个网站,用tomcat做服务器,想用一个自己定义的页面作默认主页,应该怎么设置啊?高手请指教!
---------------------------------------------------------------
在Tomcat 4.1\conf\web.xml中设置

1<welcome-file-list>
2<welcome-file>index.html</welcome-file>
3<welcome-file>index.htm</welcome-file>
4<welcome-file>index.jsp</welcome-file>
5</welcome-file-list>

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

如果想设置自己的默认页,如main.jsp,把它加入welcom-file-list中即可,如:

1<welcome-file-list>
2<welcome-file>main.jsp</welcome-file>
3<welcome-file>index.html</welcome-file>
4<welcome-file>index.htm</welcome-file>
5<welcome-file>index.jsp</welcome-file>
6</welcome-file-list>

这样当你打/时,默认的页面就是main.jsp了。

Published At
Categories with Web编程
Tagged with
comments powered by Disqus