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对静态文件,可以通过配 ...
随机推荐
- Android:使用adb命令行导出[数据库db3]文件
cmd->cd到:D:\tools\adt-bundle-windows-x86_64-20140321\adt-bundle-windows-x86_64-20140321\sdk\platf ...
- 翻译:Knockout 快速上手 - 5: 你需要知道的顶级特性 续
Utilities Knockout 提供了许多可以你开发中使用的工具,你可以在 ko.utils 命名空间中找到它们,我最喜欢的工具如下所示: extend: 这个方法将两个对象合并在一起,调用这个 ...
- C#中的委托,匿名方法和Lambda表达式
简介 在.NET中,委托,匿名方法和Lambda表达式很容易发生混淆.我想下面的代码能证实这点.下面哪一个First会被编译?哪一个会返回我们需要的结果?即Customer.ID=.答案是6个Firs ...
- WebView 获取网页点击事件
网页上的点击按钮 本身绑定了URL,点击的时候webview 会在下面的这个方法中加载URL - (BOOL)webView:(UIWebView*)webView shouldStartLoadWi ...
- Git 图解剖析
git中文件内容并没有真正存储在索引(.git/index)或者提交对象中,而是以blob的形式分别存储在数据库中(.git/objects),并用SHA-1值来校验. 索引文件用识别码列出相关的bl ...
- java中byte转换int时为何与0xff进行与运算
在剖析该问题前请看如下代码 public static String bytes2HexString(byte[] b) { String ret = ""; for (int ...
- Let's see if we could reocver Line 5.3 and above deleted chat messages or not
Forensic is a strict science and we should let the evidence speak for itself. Several months ago I s ...
- java 设计模式-代理
代理模式对其他对象提供一种代理以控制对这个对象的访问. 在某些情况下,一个对象不想或者不能直接引用另一个对象,而代理对象可以在客户端和目标对象之间起到中介的作用. 代理模式的思想 ...
- IIS7 配置URL_REWRITE
webconfig 文件 system.webServer节点下配置rewrite 报错 是因为需要安装URL重写 需要安装: https://www.microsoft.com/zh-cn/down ...
- C++利用注册表添加桌面右键新建菜单
对于程序员来说,新建一个cpp文件是再频繁不过的事情了. 为了方便,我们习惯在桌面右键新建文件,而不是新建一个文本文档,然后修改后缀名. 百度谷歌查询了一下,终于知道如何添加注册表. 手痒,抽出时间用 ...