问题描述:

在根目录webapp下的jsp页面可以通过url直接访问,而html页面就会报404错误。

解决方案1:

在spring-mvc.xml中添加如下配置:

<!--将静态文件指定到某个特殊的文件夹中统一处理-->

<mvc:resources mapping="/**"  location="/"/>

解决方案2:

在web.xml中添加:

<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>

spring mvc 配置后,web中的html页面报404,该怎么处理的更多相关文章

  1. 问题之Spring MVC配置后,可以打开jsp页面,但打不开html页面

    一.配置Spring MVC 1.导入jar spring框架:http://repo.spring.io/release/org/springframework/spring/ spring-fra ...

  2. Spring MVC - 配置Spring MVC

    写在前面的话: 现在开始一段新的学习历程:Spring MVC.还是按照原来的三步走学习模式(what.why.how)进行讲解. 1.Spring MVC是什么(what) Spring MVC属于 ...

  3. spring MVC配置详解

    现在主流的Web MVC框架除了Struts这个主力 外,其次就是Spring MVC了,因此这也是作为一名程序员需要掌握的主流框架,框架选择多了,应对多变的需求和业务时,可实行的方案自然就多了.不过 ...

  4. Spring mvc 配置详解

    现在主流的Web MVC框架除了Struts这个主力 外,其次就是Spring MVC了,因此这也是作为一名程序员需要掌握的主流框架,框架选择多了,应对多变的需求和业务时,可实行的方案自然就多了.不过 ...

  5. spring MVC配置详解(转)

    现在主流的Web MVC框架除了Struts这个主力 外,其次就是Spring MVC了,因此这也是作为一名程序员需要掌握的主流框架,框架选择多了,应对多变的需求和业务时,可实行的方案自然就多了.不过 ...

  6. Tomcat配置和Spring MVC配置

    Tomcat启动时,先找系统变量CATALINA_BASE,如果没有,则找CATALINA_HOME.然后找这个变量所指的目录下的conf文件夹,从中读取配置文件.最重要的配置文件:server.xm ...

  7. Spring MVC配置详解(3)

    一.Spring MVC环境搭建:(Spring 2.5.6 + Hibernate 3.2.0) 1. jar包引入 Spring 2.5.6:spring.jar.spring-webmvc.ja ...

  8. [转]基于Spring + Spring MVC + Mybatis 高性能web构建

    http://blog.csdn.net/zoutongyuan/article/details/41379851/ 一直想写这篇文章,前段时间 痴迷于JavaScript.NodeJs.Angula ...

  9. 基于Spring + Spring MVC + Mybatis 高性能web构建

    基于Spring + Spring MVC + Mybatis 高性能web构建 一直想写这篇文章,前段时间 痴迷于JavaScript.NodeJs.AngularJs,做了大量的研究,对前后端交互 ...

随机推荐

  1. dubbo接口未更新,清maven缓存问题

    有时候idea maven reimport 并未更新到最新的版本 此时可以到./m2去进行手动清楚缓存再更新 cd .m2/repository/cn/dface/biz/couponcenter ...

  2. Neo4j数据库学习一:安装和数据类型常用命令简介

    Neo4j数据库是图数据库 在数据库中,只有节点Nodes和关系Relationships Nodes用圆圈表示,Relationships用有向箭头表示 关系和节点都有属性(键值对) 安装3.3.7 ...

  3. Neo4j-Cypher查询语言-函数

    断言函数(Predicate functions)  函数名称 函数说明 ALL(identifier in collection WHERE predicate) 判断一个断言(predicate) ...

  4. 学习JS基本数据类型与对象的valueOf方法

    https://blog.csdn.net/licheng11403080324/article/details/60128090 https://yq.aliyun.com/articles/399 ...

  5. CentOS 7 安装详细步骤

    VMware安装centos 7 前期准备: 1. VMware虚拟机软件(使用的是15x) 2. CentOS-7-x86_64-DVD-1810.iso 一.安装VMware虚拟机软件 略 二.新 ...

  6. qdatatime大小

    QDateTime time1; QDateTime time2; uint stime = time1.toTime_t(); uint etime = time2.toTime_t(); int ...

  7. 【Luogu】【关卡2-12】递推与递归二分(2017年10月)

    任务说明:递推,层层递进,由基础推向顶层.二分不仅可以用来查找数据,还可以确定最合适的值. P1192 台阶问题 有N级的台阶,你一开始在底部,每次可以向上迈最多K级台阶(最少1级),问到达第N级台阶 ...

  8. php操作redis--字符串篇

    前提:已经安装好了redis和相关拓展 常用函数:set/get/decr/incr等 应用场景:普遍的key/value存储类型 连接: $redis = new Redis(); $redis-& ...

  9. linux IPC的FIFO

    FIFO命名管道原型: #include <sys/stat.h> int mkfifo(const char *path, mode_t mode); int mkfifoat(int ...

  10. STL lower_bound upper_bound 用法

    1.lower_bound(begin,end,x) 返回第一个>=x的位置,找不到return .end() 2.upper_bound (begin,end,x) 返回第一个>x的位置 ...