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对静态文件,可以通过配 ...
随机推荐
- git添加文件过滤
操作流程 touch .gitignore vi .gitignore,添加需要过滤的文件或目录 git commit 出现问题 假如.gitignore里面添加file,而git库中已经存在file ...
- jboss7访问日志功能及使用goaccess工具分析
网络上虽然很多文章分别讲到jboss7的访问日志如何配置,goaccess工具怎么分析nginx/tomcat等日志.但将两者放在一起即“通过goaccess分析jboss访问日志”的倒是没搜索到. ...
- ASPXGridView用法
一.ASPXGridView外观显示 属性: Caption----列的标题( KeyFieldName----数据库字段 SEOFriendly 是否启用搜索引擎优化 Summary 指定分页汇总信 ...
- C#之泛型
泛型是C# 2.0版本才有的语言特性,是具有参数类型占位符的类.结构.接口和方法.这些占位符是类.结构.接口和方法所存储或使用的一个或多个占位符.简单来说,就是变量类型的参数化. 以下是详细demo: ...
- c++ 类模版、成员函数模版、函数模版 用法
C++函数模版与类模版. template <class T> void SwapFunction(T &first, T &second){ }//函数模版 templa ...
- jquery attr()和prop()方法的使用
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 【IHttpHandler】ASP.NET 生命周期
对由 Microsoft® Internet 信息服务 (IIS) 处理的 Microsoft® ASP.NET 页面的每个请求都会被移交到 ASP.NET HTTP 管道.HTTP 管道由一系列托管 ...
- WP8_检测列表是否滑动
One of the UI features of lists on Windows Phone 7 is that the "scroll bars" don't really ...
- .NET中的访问修饰符
.NET中一共有五种访问修饰符 分别是 public 公共的,访问权限最高的. private ...
- MySQL连接语法
http://www.cnblogs.com/hanzhaoxin/p/3590642.html 内连接:INNER JOIN 内连接为 两个表中必须都同时满足条件 内连接,即最常见的等值连接自然连 ...