今天下载了几个小源码,有的默认文档为default.jsp,于是想改默认文档,不然无法显示,必须要输入完整路径才行,网上找了找也没找到,算了,自己找吧。
最后发现tomcat7.0默认文档保存位置位于安装目录下的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>
需要添加新的默认文档修改着点,添加default.jsp为默认文档这样就可以:
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
不需要重新启动tomcat,默认文档就可以生效了,不信试试?