首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

怎么配置tomcat项目的默认页面为.action或其他后缀名的方法(文件)

2013-01-23 
如何配置tomcat项目的默认页面为.action或其他后缀名的方法(文件)一般情况下,tomcat项目的默认页面为html、

如何配置tomcat项目的默认页面为.action或其他后缀名的方法(文件)
    一般情况下,tomcat项目的默认页面为html、htm和jsp页面,但是我们的主页往往是动态的。比如.action .do 或者使用了其他插件,页面的后缀名不再仅仅是那3种了。

    如果我们直接这样配置的话tomcat是不认可的。

<welcome-file-list><welcome-file>index.action</welcome-file></welcome-file-list>


    其实解决的方法和简单,只要在项目跟目录下建立一个index.action的空文件就ok了。

    根据是tomcat conf下的web.xml中有这样一段注释
  <!-- to the corresponding resource URI for display.  If no welcome file   -->
  <!-- is present, the default servlet either serves a directory listing,   -->
  <!-- or returns a 404 status, depending on how it is configured.          -->

热点排行