zoukankan      html  css  js  c++  java
  • 关于web.xml中的<welcome-file-list>

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

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

    回答:

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

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

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

  • 相关阅读:
    C#获取MAC地址
    C#洗牌
    删除前提示
    简单MD5加密
    读取EXCEL所有列名C#
    gridview二次加载样式丢失
    迅雷API接口(及示例演示)
    [转]Servlet过滤器介绍之原理分析
    [转]MySQL运行状态show status中文详解
    [转]如何修改mysql root密码
  • 原文地址:https://www.cnblogs.com/jpfss/p/7116372.html
Copyright © 2011-2022 走看看