Did not find handler method for springMVC资源文件扫描不到---关于spring的那些坑
今天将项目的spring版本升级到4.2.5版本后,登录首页发现资源文件全部访问不到,页面彻底挂掉;
查找原因,后来又查找spring的更新文档后,才确认下来原来是mvc-dispatcher-servlet.xml中静态资源文件的配置写的有问题
//下面这个是旧版本我们之前写的配置文件
<mvc:resources location="/assets/**" mapping="/assets/**" />
<mvc:resources location="/public/**" mapping="/public/**" />
<mvc:resources location="/upload/**" mapping="/upload/**" />
//下面是spring官方给出的配置文件的格式,原因就是location配置项后面多加的两个【**】,貌似旧的spring 3.x 版本可以支持后面加【**】这种的配置,更新到4.x之后就不行了
<mvc:resources location="/assets/" mapping="/assets/**" />
<mvc:resources location="/public/" mapping="/public/**" />
<mvc:resources location="/upload/" mapping="/upload/**" />
今天又遇到一个坑,升级之后controller中的方法体会执行两次,版本返回旧的就OK,目前未知原因,后续更新;
谨将此记录下来,造福后来人
如果觉得有帮助,请点赞……
Did not find handler method for springMVC资源文件扫描不到---关于spring的那些坑的更多相关文章
- springmvc资源文件访问不到,undefined,jsp引用js文件目录
资源访问失败: 该模块下springmvc.xml文件中添加配置: <mvc:resources mapping="/js/**" location="/js/&q ...
- 【Spring】获取资源文件+从File+从InputStream对象获取正文数据
1.获取资源文件或者获取文本文件等,可以通过Spring的Resource的方式获取 2.仅有File对象即可获取正文数据 3.仅有InputStream即可获取正文数据 package com.sx ...
- 装载Properties资源文件的项目中使用
ssm项目中打算将发短信的每小时每天的限定变成可配置的.于是将配置信息写在资源文件中,现在有两种方式加载资源文件,一个是使用spring注入方式,@Value注解注入,当然,前面需要在项目中装载.第二 ...
- Springmvc的handler method参数绑定常用的注解
转自:http://blog.longjiazuo.com/archives/1149 1. 简介: handler method参数绑定常用的注解,我们根据他们处理的Request的不同内容部分 ...
- SpringMVC 资源国际化实现以及常见问题
资源国际化可以很方便的实现web项目语言的切换,解决了web项目按需显示不同语言界面的问题. SpringMVC 的资源国际化基于JDK的java.util.ResourceBundle实现,经过Sp ...
- spring 笔记2:Spring MVC : Did not find handler method for 问题的解决
日志显示为: Looking up handler method for path /***Did not find handler method for [/***]No mapping found ...
- SpringMVC+FreeMarker实现静态资源文件自动添加版本号(md5)
近日切换java开发,开始学习springframework.在实现静态资源文件自动计算版本号的实例时,因为不熟悉框架,走了不少弯路,好在最终解决了问题.这里写篇文章记录一下实现,也希望对大家有些用处 ...
- 防止SpringMVC拦截器拦截js等静态资源文件
SpringMVC提供<mvc:resources>来设置静态资源,但是增加该设置如果采用通配符的方式增加拦截器的话仍然会被拦截器拦截,可采用如下方案进行解决: 方案一.拦截器中增加针对静 ...
- 在JSP中常见问题,防止SpringMVC拦截器拦截js等静态资源文件的解决方案
方案一.拦截器中增加针对静态资源不进行过滤(涉及spring-mvc.xml) <mvc:resources location="/" mapping="/**/* ...
随机推荐
- ajax与HTML5 history pushState/replaceState实例
一.本文就是个实例展示 三点: 我就TM想找个例子,知道如何个使用,使用语法什么的滚粗 跟搜索引擎搞基 自己备忘 精力总是有限的,昨天一冲动,在上海浦东外环之外订了个90米的房子,要借钱筹首付.贷款和 ...
- BNUOJ48605International Collegiate Routing Contest 题解
题目大意: 给你一些子网,求它们在整个网段的补集. 思路: 将子网转换成二进制建一棵Trie,直接DFS搜到没有了就记下来输出.注意:所给的子网会有交集,若搜到结尾就不向下搜了. 代码: #inclu ...
- iOS 自动布局小结
1> sizeclasses 可以限制某个 storyboard 显示在什么样的屏幕上,如 当前 storyboard 在iPhone 的左斜右斜或 iPad上是否显示.. 2> Hug值 ...
- Spring 整合 Redis(二)
pom构建: <modelVersion>4.0.0</modelVersion> <groupId>com.x.redis</groupId> < ...
- jQuery延迟加载(懒加载)插件 – jquery.lazyload.js
引入:<script type="text/javascript" src="${base}/resources/shop/js/jquery.lazyload.j ...
- Find a way——L
L. Find a way Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave N ...
- [CareerCup] 18.5 Shortest Distance between Two Words 两单词间的最短距离
18.5 You have a large text file containing words. Given any two words, find the shortest distance (i ...
- [CareerCup] 17.6 Sort Array 排列数组
17.6 Given an array of integers, write a method to find indices m and n such that if you sorted elem ...
- iOS Notification 的使用
Notification post notification,notification,notification,notification,notification,n otification ,no ...
- jquery实现获取手机验证码倒计时效果
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...