随笔 - 0, 文章 - 264, 评论 - 170, 引用 - 0
数据加载中……

关于web.xml中的(注:转载于http://yjshengshe.javaeye.com/blog/641934)

问题:
<welcome-file-list>中的<welcome-file>标签部分除了放具体的jsp或html页面(例如下)
  <welcome-file-list>
  <welcome-file>index.jsp</welcome-file>
  <welcome-file>index.html</welcome-file>
  </welcome-file-list>
外能不能放一个请求在里面?(例如下)
  <welcome-file-list>
  <welcome-file>index.do</welcome-file>
  </welcome-file-list>

我用spring MVC,按照以下配置
  <welcome-file-list>
  <welcome-file>index.do</welcome-file>
  </welcome-file-list>
启动服务器,终是报404错误,但我在地址栏手工加入index.do时,页面正常显示,这是为什么,是不是服务器不支持这样的写法(index.do)????如果支持应该如何写????

回答:

支持...不过tomcat 会去检查有没有index.do这个文件.

意思大概就是这样,首先读取 welcome list,然后取得第一个index,然后到web中的路径中查找有没有这个文件,没有继续第二个.
然后继续下去没有,就提示没有主页.

解决办法:
在你的WebRoot 下添加一个空白的文件命名为 index.do

posted on 2010-12-26 10:21 小一败涂地 阅读(412) 评论(0)  编辑  收藏 所属分类: tomcat、apache、jboss等服务器相关


只有注册用户登录后才能发表评论。


网站导航: