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

  • 相关阅读:
    auth
    django缓存机制
    图片防盗链
    用户相关
    验证码
    单个容器部署django (docker + django + uwsgi)
    MySQL性能调优的10个方法
    数据库-外键
    数据库(存储引擎、字段类型、约束条件)
    数据库
  • 原文地址:https://www.cnblogs.com/jpfss/p/7116372.html
Copyright © 2011-2022 走看看