spring debug
DispatcherServlet{
getHandler()
}
handlerMappings{
RequestMappingHandlerMapping
BeanNameUrlHandlerMapping
WebMvcConfigurationSupport
}
BeanNameUrlHandlerMapping{
determineUrlsForHandler() //加断点 可知 urlmapping有没有正确
}
RequestMappingHandlerMapping{
createRequestMappingInfo() //url成功了才到这
}
RequestMappingHandlerAdapter {
handleInternal //加断点
}
SimpleControllerHandlerAdapter,
SimplePortletHandlerAdapter
检查handlerMappings 在以下代码 启动时断点
private void initHandlerMappings(ApplicationContext context) {
this.handlerMappings = null;
if (this.detectAllHandlerMappings) {
// Find all HandlerMappings in the ApplicationContext, including ancestor contexts.
Map<String, HandlerMapping> matchingBeans =
BeanFactoryUtils.beansOfTypeIncludingAncestors(context, HandlerMapping.class, true, false);
if (!matchingBeans.isEmpty()) {
this.handlerMappings = new ArrayList<HandlerMapping>(matchingBeans.values());
// We keep HandlerMappings in sorted order.
AnnotationAwareOrderComparator.sort(this.handlerMappings);
}
}
BeanNameUrlHandlerMapping{
determineUrlsForHandler
}
RequestMappingHandlerMapping 以前的DefaultAnnotationHandlerMapping
AbstractHandlerMapping{
getHandler 真正作urlmatch
}
AbstractHandlerMethodMapping{
getHandlerInternal
protected HandlerMethod lookupHandlerMethod(String lookupPath, HttpServletRequest request) throws Exception {
List<Match> matches = new ArrayList<Match>();
List<T> directPathMatches = this.mappingRegistry.getMappingsByUrl(lookupPath);
}
spring debug的更多相关文章
- Spring+SpringMVC+mybatis框架整合
1.jdbc.properties 1 driverClassName=com.mysql.jdbc.Driver 2 url=jdbc\:mysql\://127.0.0.1\:3306/slsal ...
- Spring Boot 数据访问集成 MyBatis 与事物配置
对于软件系统而言,持久化数据到数据库是至关重要的一部分.在 Java 领域,有很多的实现了数据持久化层的工具和框架(ORM).ORM 框架的本质是简化编程中操作数据库的繁琐性,比如可以根据对象生成 S ...
- Spring MVC的Rest URL 被错误解析成jsp, 导致404错误(XML方式下@Controller和@RestController需要配置<mvc:annotation-driving/>)
问题: 最近在原有MVC的WEB应用中添加一个REST服务,结果始终报404错误.把 Spring debug 日志打开,发现处理REST请求的Controller已经正确进入 [org.spring ...
- Spring整合Mybatis案例,献给初学的朋友
今天我们来学习Spring整合Mybatis. 开发环境:Ide:MyEclipse 2017 CI JDK:1.8 首先我们简单的认识下这两个框架 1.Mybatis MyBatis是一个支持普通S ...
- 30Mybatis_mybatis和spring整合-原始dao开发
这篇文章很重要, 第一步:我们讲一下整合的思路: 我们以前要用Mybatis是需要sqlMapConfig.xml(这个配置文件需要配置dataource,以及mapper.xml文件.)sqlMap ...
- 基于Maven的Spring + Spring MVC + Mybatis的环境搭建
基于Maven的Spring + Spring MVC + Mybatis的环境搭建项目开发,先将环境先搭建起来.上次做了一个Spring + Spring MVC + Mybatis + Log4J ...
- Spring需要的几个关键配置文件(SSM框架整合)
打包下载 springmvc-servlet.xml <?xml version="1.0" encoding="UTF-8"?> <bean ...
- Spring(四)Spring与数据库编程
Spring最重要的功能毫无疑问就是操作数据.数据库的百年城是互联网编程的基础,Spring为开发者提供了JDBC模板模式,那就是它自身的JdbcTemplate.Spring还提供了Transact ...
- spring boot 配置静态路径
一 前言 最近有个项目,需要上传一个zip文件(zip文件就是一堆的html压缩组成)的压缩文件,然后后端解压出来,用户可以预览上传好的文件. 查看资料,spring boot对静态文件,可以通过配 ...
随机推荐
- 2014年值得学习的25个PS CS6教程(一)
热爱PS的朋友看过来~~~下面跟大家推荐10个高端大气上档次的PS教程(都是英文的哦) 1.为4D电影创建一副3D海报 2.制作3D水果文字 3.肖像图混合数字工艺 4.‘Doctrich – Pos ...
- js数据结构与算法存储结构
数据结构(程序设计=数据结构+算法) 数据结构就是关系,没错,就是数据元素相互之间存在的一种或多种特定关系的集合. 传统上,我们把数据结构分为逻辑结构和物理结构. 逻辑结构:是指数据对象中数据元素之间 ...
- MVC session过期如何处理跳转
以前我们总是会写一个基类也叫父类来判断session是否已过期然后跳转到指定的错误页面或者登陆界面,然后让所有的页面都继承这个基类,但是当我们应用到MVC项目中时,发现该方法并不会起作用.这时我们可以 ...
- Type-base dispatch
In the previous section we added two Time objects, but you also might want to add an integer to a Ti ...
- -(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
在有全屏侧滑的情况下,页面上有个slider需要左右滑动的时候,经常在滑动slider的时候页面也跟着滑动 解决办法一:关闭当前页面的全屏侧滑,开启系统侧滑 self ...
- java中反射
Person.java===>>person.class ==>>jvm中的类加载器===>>class对象:代表内存中Person.class ==>> ...
- asp.net 页面url重写
不更改情况下,页面路径为index.aspx?id=1,现在输入页面路径index/1时,也能访问到页面,这一过程叫做url重写 ①:在一个类里制定路径重写规则,以下为自定义UrlRewriterFi ...
- android Camera使用(一)
现在的App不可避免的要使用到手机的相机功能 首先我们先来介绍下最简单的一个实现方式,启动系统自带的Activity 上代码: public void openCamera() { Intent i= ...
- ios项目记录
1,如何隐藏状态栏 在基类中重载UIViewController.h中的这个方法 - (BOOL)prefersStatusBarHidden { // iOS7后,[[UIApplication s ...
- CSS现代字体栈
CSS字体栈是一系列的字体,它包含了能在不同操作系统和平台上战士的字体,以尽可能的使排版保持一致性.浏览器会在font-family规定的所有字体中从前往后一次查找,如果找不到当前字体就查找下一个字体 ...