- 浏览: 209495 次
- 性别:
- 来自: 深圳
文章分类
- 全部博客 (391)
- java (18)
- python (3)
- ruby (4)
- linux (48)
- 网络 (9)
- 前端 (2)
- 社会、文化、哲学、人生、百态 (0)
- 工具 (10)
- 下载 (0)
- 常用地址 (0)
- tracert (0)
- mysql (8)
- 开源相关收藏 (1)
- 模块查看依懒 (1)
- watch使用 (1)
- Tcpdump (2)
- easy_install安装 (1)
- 构造redis批量删除脚本 (1)
- MYSQL 性能测试 (1)
- JAVA code encode utf-8 (1)
- linux nginx awk 实时 每妙 (1)
- mkpasswd (1)
- spring security oauth (1)
- jmap dump java memory Analyzer (1)
- JAVA DUMP (1)
- swap linux 过高 解决 (1)
- SWAP (1)
- jmap jstat jstack dump (1)
- java jconsole 的使用 (1)
- git 常用 (1)
- MYSQL 索引 动态 唯一 (1)
- TCP 三次握手 四次挥手 (1)
- linux date (1)
- 删除 空行 注释行 (1)
- maven3 yum linux install repository (1)
- linux git 搭建 (1)
- linux sar eth1 查看 流量 (1)
- sar (1)
- netstat ip 过滤 常用脚本 (1)
- Tcpdump 包分析网络连接过程 (1)
- net ipv4 tcp time wait tw recycle (0)
- /etc/sysctl.conf linux 网络 配置 (1)
- ss 网络连接查看 (比netstat 快很多,实时性牺牲) (1)
- MYSQL 关键字 (1)
- Linux 下多核CPU知识 (1)
- top (1)
- 令牌 证书 (1)
- mysql unix timestamp (1)
- 端口扫描 nc nmap (1)
- 204 http code 状态码 (1)
- ss -s ss -l (1)
- linux 常用 curl (1)
- linux sed 替换 换行 (1)
- centos yum install rpm install (1)
- spring-mvc源码解读 (1)
- 使用iftop查看实时的网络流量 (0)
- linux 命令 expect (1)
- HTTP (1)
- openssl ddif 加密 (1)
- iptables 详解 (1)
- python 虚拟化 VirtualEnv virtualenvwrapper (1)
- nginx (2)
- more less 实用技巧 (1)
- linux nginx (2)
- linux curl https ssl 证书 ca (1)
- openssl (1)
- php mysql linux (1)
- linux 虚拟机 虚拟 xen (0)
- linux 虚拟机 虚拟 xen kvm (1)
- linux perl 单行执行技巧 (1)
- mysql 查看库占用空间 表查用空间 (1)
- linux tcpdump (1)
- maven (1)
- sun.misc.Unsafe (1)
- OpenSSL生成证书 (1)
- http://blog.csdn.net/zzulp/article/details/8018751 (1)
- maven 本地 jar dependency (1)
- 计算JAVA代码行数最简单命令 sed (1)
- 常用的证书格式转换 rsa eg (1)
- 加密 解密 签名 (1)
- 分析jar包冲突 (1)
- 使用JMockit编写java单元测试 (1)
- Linux 技巧:让进程在后台可靠运行的几种方法 (1)
- 环境变量控制 (1)
- 5+ 个 tar 命令的用法,附示例 (1)
- scp自动输入密码 (1)
- ps axo pid (1)
- ppid (1)
- comm (1)
- pmem (1)
- lstart|grep mysql (0)
- lstart (1)
- etime|grep mysql (1)
- UML类图字少好理解 (1)
- HTTP经典文章 (1)
- git (1)
- Git常用命令 (1)
- LINUX 系统被攻击的分析过程 (1)
- NIO (1)
- LINUX 操作快捷键使用 (1)
- openSSL命令、PKI、CA、SSL证书原理 (1)
- shell (2)
- 转载 (1)
- mysqldump 可以直接dump->xml (1)
- VIM比较全面的文章 (1)
- eclipse regex 正则表达式 (1)
- synchronized (1)
- 锁 (1)
- java 正则表达式 regex (1)
- Reference Queue 引用 源码 (1)
- spring aop 源码 分析 (1)
- java @Cache @Transaction 注解 (1)
- spring aop (1)
- spring jdk proxy cglib 动态代理 性能比较 (1)
- spring proxy private public 代理限制 (1)
- spring transaction aop 事务 (1)
- spring autowire 注解注入 (1)
- 桥接 NAT NAT地址转换 内部网络 虚拟网络 (1)
- spring-web-mvc 源码解读 之 RequestMappingHandlerMapping (1)
- find atime mtime ctime -n n +n (1)
- android studio 快捷键初探 (1)
- android 源码阅读的计划 (1)
- 计算机网络学习-VLAN (1)
- sed 高级 合并行 (1)
- CAP 一致性 可用性 分布式容错性 (1)
- android lib so 库文件 (0)
- android lib so 库文件 移植 (1)
- android 不错的博文 (1)
- sourceinsight 源码 阅读 (1)
- Android Tab UI (1)
- 诗 (1)
- mysql 批处理 (0)
- netty 堆外内存 DirectByteBuffer (1)
- netty 并发 百万 推送 (1)
- Linux操作系统中内存buffer和cache的区别 (1)
- maven intellij target bytecode version (1)
- linux sleep()的实现原理 (1)
- android (2)
- javadoc 代码注释规范 (1)
- spring 自动注入bean auto (1)
- Photoshop CS6常用快捷键 (1)
- 股票 数据 机器 分析 (1)
- 批处理 (1)
- mysql -e (1)
- char (1)
- Unicode (1)
- 编码 (1)
- utf8 (1)
- utf-8 (1)
- utf16 (1)
- utf-16 (1)
- IntelliJ IDEA (1)
- ide (1)
- idea (1)
- intellij (1)
- 文件 (1)
- 目录 (1)
- 源代码 (1)
- CountDownLatch (1)
- CyclicBarrier (1)
- Semaphore (1)
- spring (1)
- linux 查看不同进制文件 (1)
- WebMvcConfigurationSupport (1)
- sdkman工具的使用 (1)
- http header (1)
- LINUX系统优化 (1)
最新评论
-
gelongmei:
威武我大酒神
shell脚本不换行刷新数据
费弃使用
DefaultAnnotationHandlerMapping
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter
RequestMappingHandlerMapping
org.springframework.web.servlet.handler.AbstractHandlerMethodMapping<T>
org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.urlMap
入口 :
class org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
定位controller
org.springframework.web.servlet.HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE
org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.Match<T>
org.springframework.web.method.HandlerMethod
http://www.springframework.org/schema/context/spring-context-3.2.xsd
org.springframework.beans.factory.support.DefaultListableBeanFactory@331fc69a:
defining beans [
mvcContentNegotiationManager,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0,
org.springframework.format.support.FormattingConversionServiceFactoryBean#0,
org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0,
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,
org.springframework.web.servlet.handler.MappedInterceptor#0,
org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0,
org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0,
org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0,
org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,
org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,
org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,
org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler#0,
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#1,
viewResolver,
localeResolver,
accountOauthController,
dealOauthController,
orderOauthController,
dwrLoginController,dwrPhoneController,
chargeSystemController,
systemController,
memberPaySystemWebjspController,
testController,
memberPayWebjspController,
buyPartnerOrderWebserviceController,
couponWebserviceController,
testWebserviceController,
org.springframework.context.annotation.internalConfigurationAnnotationProcessor,
org.springframework.context.annotation.internalAutowiredAnnotationProcessor,
org.springframework.context.annotation.internalRequiredAnnotationProcessor,
org.springframework.context.annotation.internalCommonAnnotationProcessor,
org.springframework.context.annotation.internalPersistenceAnnotationProcessor,
org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor
];
parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@3e91d58b
org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite
//执行请求
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(HttpServletRequest, HttpServletResponse, HandlerMethod)
org.springframework.web.method.annotation.ModelFactory
//解决controller上下文参数传递补充
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(NativeWebRequest, ModelAndViewContainer, Object...)
org.springframework.web.method.support.HandlerMethodArgumentResolverComposite@33125360
org.springframework.web.servlet.mvc.method.annotation.ServletRequestDataBinderFactory@60ee6bef
org.springframework.web.servlet.mvc.method.annotation.ServletResponseMethodArgumentResolver.resolveArgument(MethodParameter, ModelAndViewContainer, NativeWebRequest, WebDataBinderFactory)
//删除request
org.springframework.web.util.WebUtils.clearErrorRequestAttributes(HttpServletRequest)
request.removeAttribute(ERROR_STATUS_CODE_ATTRIBUTE);
request.removeAttribute(ERROR_EXCEPTION_TYPE_ATTRIBUTE);
request.removeAttribute(ERROR_MESSAGE_ATTRIBUTE);
request.removeAttribute(ERROR_EXCEPTION_ATTRIBUTE);
request.removeAttribute(ERROR_REQUEST_URI_ATTRIBUTE);
request.removeAttribute(ERROR_SERVLET_NAME_ATTRIBUTE);
//重点,
org.springframework.web.servlet.mvc.method.annotation.ServletRequestMethodArgumentResolver.resolveArgument(MethodParameter, ModelAndViewContainer, NativeWebRequest, WebDataBinderFactory)
org.springframework.web.method.support.HandlerMethodArgumentResolverComposite@709fd7e8
//参数映射解决统一接口
org.springframework.web.method.support.HandlerMethodArgumentResolver
org.springframework.web.method.support.HandlerMethodArgumentResolverComposite@709fd7e8
{
org.springframework.web.method.HandlerMethod$HandlerMethodParameter@d3ab010b=org.springframework.web.method.annotation.RequestParamMethodArgumentResolver@7fc429b2,
org.springframework.web.method.HandlerMethod$HandlerMethodParameter@d3ab010c=org.springframework.web.method.annotation.RequestParamMethodArgumentResolver@1b8d6b0,
org.springframework.web.method.HandlerMethod$HandlerMethodParameter@d3ab010d=org.springframework.web.servlet.mvc.method.annotation.ServletRequestMethodArgumentResolver@2fa5e12a
}
[
org.springframework.web.method.annotation.RequestParamMethodArgumentResolver@,
org.springframework.web.method.annotation.RequestParamMapMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.PathVariableMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.PathVariableMapMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.MatrixVariableMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.MatrixVariableMapMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor@,
org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor@,
org.springframework.web.servlet.mvc.method.annotation.RequestPartMethodArgumentResolver@,
org.springframework.web.method.annotation.RequestHeaderMethodArgumentResolver@,
org.springframework.web.method.annotation.RequestHeaderMapMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.ServletCookieValueMethodArgumentResolver@,
org.springframework.web.method.annotation.ExpressionValueMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.ServletRequestMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.ServletResponseMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.HttpEntityMethodProcessor@,
org.springframework.web.servlet.mvc.method.annotation.RedirectAttributesMethodArgumentResolver@,
org.springframework.web.method.annotation.ModelMethodProcessor@,
org.springframework.web.method.annotation.MapMethodProcessor@,
org.springframework.web.method.annotation.ErrorsMethodArgumentResolver@,
org.springframework.web.method.annotation.SessionStatusMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.UriComponentsBuilderMethodArgumentResolver@,
org.springframework.web.method.annotation.RequestParamMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor@
]
[org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor
类LocaleChangeInterceptor为spring-webmvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
// /favicon.ico走的是 DefaultServletHttpRequestHandler !注
java.lang.ClassCastException: org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler cannot be cast to org.springframework.web.method.HandlerMethod
DispatcherServlet
handlerMappings
[
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping@9b24a8e,
org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping@183cb59b,
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping@39b6df8b,
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping@150e3c47]
org.springframework.security.web.access.ExceptionTranslationFilter
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
try {
chain.doFilter(request, response);
logger.debug("Chain processed normally");
}
catch (IOException ex) {
throw ex;
}
catch (Exception ex) {
// Try to extract a SpringSecurityException from the stacktrace
Throwable[] causeChain = throwableAnalyzer.determineCauseChain(ex);
RuntimeException ase = (AuthenticationException)
throwableAnalyzer.getFirstThrowableOfType(AuthenticationException.class, causeChain);
if (ase == null) {
ase = (AccessDeniedException)throwableAnalyzer.getFirstThrowableOfType(AccessDeniedException.class, causeChain);
}
if (ase != null) {
//用于保存没有权限访问的请求
handleSpringSecurityException(request, response, chain, ase);
//关键流程核心类
org.springframework.web.filter.GenericFilterBean
//spring 核心配置,BEAN定义解析类
org.springframework.beans.factory.xml.BeanDefinitionParser
org.springframework.beans.factory.support.DefaultListableBeanFactory
org.springframework.beans.factory.support.BeanDefinitionRegistry
//命名空间
org.springframework.beans.factory.xml.NamespaceHandlerSupport
org.springframework.beans.factory.config.BeanDefinitionHolder
//spring-security
org.springframework.security.oauth2.config.OAuth2SecurityNamespaceHandler
public class OAuth2SecurityNamespaceHandler extends NamespaceHandlerSupport {
public void init() {
registerBeanDefinitionParser("authorization-server", new AuthorizationServerBeanDefinitionParser());
registerBeanDefinitionParser("resource-server", new ResourceServerBeanDefinitionParser());
registerBeanDefinitionParser("client-details-service", new ClientDetailsServiceBeanDefinitionParser());
registerBeanDefinitionParser("client", new ClientBeanDefinitionParser());
registerBeanDefinitionParser("resource", new ResourceBeanDefinitionParser());
registerBeanDefinitionParser("rest-template", new RestTemplateBeanDefinitionParser());
registerBeanDefinitionParser("expression-handler", new ExpressionHandlerBeanDefinitionParser());
registerBeanDefinitionParser("web-expression-handler", new WebExpressionHandlerBeanDefinitionParser());
}
}
//component-scan
public class ContextNamespaceHandler extends NamespaceHandlerSupport {
public void init() {
registerBeanDefinitionParser("property-placeholder", new PropertyPlaceholderBeanDefinitionParser());
registerBeanDefinitionParser("property-override", new PropertyOverrideBeanDefinitionParser());
registerBeanDefinitionParser("annotation-config", new AnnotationConfigBeanDefinitionParser());
registerBeanDefinitionParser("component-scan", new ComponentScanBeanDefinitionParser());
registerBeanDefinitionParser("load-time-weaver", new LoadTimeWeaverBeanDefinitionParser());
registerBeanDefinitionParser("spring-configured", new SpringConfiguredBeanDefinitionParser());
registerBeanDefinitionParser("mbean-export", new MBeanExportBeanDefinitionParser());
registerBeanDefinitionParser("mbean-server", new MBeanServerBeanDefinitionParser());
}
}
//WebApplicationContext
org.springframework.web.context.support.XmlWebApplicationContext
org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler
public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter implements BeanFactoryAware,
InitializingBean {
private List<HandlerMethodArgumentResolver> customArgumentResolvers;
private HandlerMethodArgumentResolverComposite argumentResolvers;
private HandlerMethodArgumentResolverComposite initBinderArgumentResolvers;
private List<HandlerMethodReturnValueHandler> customReturnValueHandlers;
private HandlerMethodReturnValueHandlerComposite returnValueHandlers;
private List<ModelAndViewResolver> modelAndViewResolvers;
private ContentNegotiationManager contentNegotiationManager = new ContentNegotiationManager();
private List<HttpMessageConverter<?>> messageConverters;
private WebBindingInitializer webBindingInitializer;
private AsyncTaskExecutor taskExecutor = new SimpleAsyncTaskExecutor("MvcAsync");
private Long asyncRequestTimeout;
private CallableProcessingInterceptor[] callableInterceptors = new CallableProcessingInterceptor[] {};
private DeferredResultProcessingInterceptor[] deferredResultInterceptors = new DeferredResultProcessingInterceptor[] {};
private boolean ignoreDefaultModelOnRedirect = false;
private int cacheSecondsForSessionAttributeHandlers = 0;
private boolean synchronizeOnSession = false;
private SessionAttributeStore sessionAttributeStore = new DefaultSessionAttributeStore();
private ParameterNameDiscoverer parameterNameDiscoverer = new LocalVariableTableParameterNameDiscoverer();
private ConfigurableBeanFactory beanFactory;
DefaultAnnotationHandlerMapping
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter
RequestMappingHandlerMapping
org.springframework.web.servlet.handler.AbstractHandlerMethodMapping<T>
org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.urlMap
入口 :
class org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
定位controller
org.springframework.web.servlet.HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE
org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.Match<T>
org.springframework.web.method.HandlerMethod
http://www.springframework.org/schema/context/spring-context-3.2.xsd
org.springframework.beans.factory.support.DefaultListableBeanFactory@331fc69a:
defining beans [
mvcContentNegotiationManager,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0,
org.springframework.format.support.FormattingConversionServiceFactoryBean#0,
org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0,
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,
org.springframework.web.servlet.handler.MappedInterceptor#0,
org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0,
org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0,
org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0,
org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,
org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,
org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,
org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler#0,
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#1,
viewResolver,
localeResolver,
accountOauthController,
dealOauthController,
orderOauthController,
dwrLoginController,dwrPhoneController,
chargeSystemController,
systemController,
memberPaySystemWebjspController,
testController,
memberPayWebjspController,
buyPartnerOrderWebserviceController,
couponWebserviceController,
testWebserviceController,
org.springframework.context.annotation.internalConfigurationAnnotationProcessor,
org.springframework.context.annotation.internalAutowiredAnnotationProcessor,
org.springframework.context.annotation.internalRequiredAnnotationProcessor,
org.springframework.context.annotation.internalCommonAnnotationProcessor,
org.springframework.context.annotation.internalPersistenceAnnotationProcessor,
org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor
];
parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@3e91d58b
org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite
//执行请求
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(HttpServletRequest, HttpServletResponse, HandlerMethod)
org.springframework.web.method.annotation.ModelFactory
//解决controller上下文参数传递补充
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(NativeWebRequest, ModelAndViewContainer, Object...)
org.springframework.web.method.support.HandlerMethodArgumentResolverComposite@33125360
org.springframework.web.servlet.mvc.method.annotation.ServletRequestDataBinderFactory@60ee6bef
org.springframework.web.servlet.mvc.method.annotation.ServletResponseMethodArgumentResolver.resolveArgument(MethodParameter, ModelAndViewContainer, NativeWebRequest, WebDataBinderFactory)
//删除request
org.springframework.web.util.WebUtils.clearErrorRequestAttributes(HttpServletRequest)
request.removeAttribute(ERROR_STATUS_CODE_ATTRIBUTE);
request.removeAttribute(ERROR_EXCEPTION_TYPE_ATTRIBUTE);
request.removeAttribute(ERROR_MESSAGE_ATTRIBUTE);
request.removeAttribute(ERROR_EXCEPTION_ATTRIBUTE);
request.removeAttribute(ERROR_REQUEST_URI_ATTRIBUTE);
request.removeAttribute(ERROR_SERVLET_NAME_ATTRIBUTE);
//重点,
org.springframework.web.servlet.mvc.method.annotation.ServletRequestMethodArgumentResolver.resolveArgument(MethodParameter, ModelAndViewContainer, NativeWebRequest, WebDataBinderFactory)
org.springframework.web.method.support.HandlerMethodArgumentResolverComposite@709fd7e8
//参数映射解决统一接口
org.springframework.web.method.support.HandlerMethodArgumentResolver
org.springframework.web.method.support.HandlerMethodArgumentResolverComposite@709fd7e8
{
org.springframework.web.method.HandlerMethod$HandlerMethodParameter@d3ab010b=org.springframework.web.method.annotation.RequestParamMethodArgumentResolver@7fc429b2,
org.springframework.web.method.HandlerMethod$HandlerMethodParameter@d3ab010c=org.springframework.web.method.annotation.RequestParamMethodArgumentResolver@1b8d6b0,
org.springframework.web.method.HandlerMethod$HandlerMethodParameter@d3ab010d=org.springframework.web.servlet.mvc.method.annotation.ServletRequestMethodArgumentResolver@2fa5e12a
}
[
org.springframework.web.method.annotation.RequestParamMethodArgumentResolver@,
org.springframework.web.method.annotation.RequestParamMapMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.PathVariableMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.PathVariableMapMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.MatrixVariableMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.MatrixVariableMapMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor@,
org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor@,
org.springframework.web.servlet.mvc.method.annotation.RequestPartMethodArgumentResolver@,
org.springframework.web.method.annotation.RequestHeaderMethodArgumentResolver@,
org.springframework.web.method.annotation.RequestHeaderMapMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.ServletCookieValueMethodArgumentResolver@,
org.springframework.web.method.annotation.ExpressionValueMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.ServletRequestMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.ServletResponseMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.HttpEntityMethodProcessor@,
org.springframework.web.servlet.mvc.method.annotation.RedirectAttributesMethodArgumentResolver@,
org.springframework.web.method.annotation.ModelMethodProcessor@,
org.springframework.web.method.annotation.MapMethodProcessor@,
org.springframework.web.method.annotation.ErrorsMethodArgumentResolver@,
org.springframework.web.method.annotation.SessionStatusMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.UriComponentsBuilderMethodArgumentResolver@,
org.springframework.web.method.annotation.RequestParamMethodArgumentResolver@,
org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor@
]
[org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor
类LocaleChangeInterceptor为spring-webmvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
// /favicon.ico走的是 DefaultServletHttpRequestHandler !注
java.lang.ClassCastException: org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler cannot be cast to org.springframework.web.method.HandlerMethod
DispatcherServlet
handlerMappings
[
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping@9b24a8e,
org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping@183cb59b,
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping@39b6df8b,
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping@150e3c47]
org.springframework.security.web.access.ExceptionTranslationFilter
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
try {
chain.doFilter(request, response);
logger.debug("Chain processed normally");
}
catch (IOException ex) {
throw ex;
}
catch (Exception ex) {
// Try to extract a SpringSecurityException from the stacktrace
Throwable[] causeChain = throwableAnalyzer.determineCauseChain(ex);
RuntimeException ase = (AuthenticationException)
throwableAnalyzer.getFirstThrowableOfType(AuthenticationException.class, causeChain);
if (ase == null) {
ase = (AccessDeniedException)throwableAnalyzer.getFirstThrowableOfType(AccessDeniedException.class, causeChain);
}
if (ase != null) {
//用于保存没有权限访问的请求
handleSpringSecurityException(request, response, chain, ase);
//关键流程核心类
org.springframework.web.filter.GenericFilterBean
//spring 核心配置,BEAN定义解析类
org.springframework.beans.factory.xml.BeanDefinitionParser
org.springframework.beans.factory.support.DefaultListableBeanFactory
org.springframework.beans.factory.support.BeanDefinitionRegistry
//命名空间
org.springframework.beans.factory.xml.NamespaceHandlerSupport
org.springframework.beans.factory.config.BeanDefinitionHolder
//spring-security
org.springframework.security.oauth2.config.OAuth2SecurityNamespaceHandler
public class OAuth2SecurityNamespaceHandler extends NamespaceHandlerSupport {
public void init() {
registerBeanDefinitionParser("authorization-server", new AuthorizationServerBeanDefinitionParser());
registerBeanDefinitionParser("resource-server", new ResourceServerBeanDefinitionParser());
registerBeanDefinitionParser("client-details-service", new ClientDetailsServiceBeanDefinitionParser());
registerBeanDefinitionParser("client", new ClientBeanDefinitionParser());
registerBeanDefinitionParser("resource", new ResourceBeanDefinitionParser());
registerBeanDefinitionParser("rest-template", new RestTemplateBeanDefinitionParser());
registerBeanDefinitionParser("expression-handler", new ExpressionHandlerBeanDefinitionParser());
registerBeanDefinitionParser("web-expression-handler", new WebExpressionHandlerBeanDefinitionParser());
}
}
//component-scan
public class ContextNamespaceHandler extends NamespaceHandlerSupport {
public void init() {
registerBeanDefinitionParser("property-placeholder", new PropertyPlaceholderBeanDefinitionParser());
registerBeanDefinitionParser("property-override", new PropertyOverrideBeanDefinitionParser());
registerBeanDefinitionParser("annotation-config", new AnnotationConfigBeanDefinitionParser());
registerBeanDefinitionParser("component-scan", new ComponentScanBeanDefinitionParser());
registerBeanDefinitionParser("load-time-weaver", new LoadTimeWeaverBeanDefinitionParser());
registerBeanDefinitionParser("spring-configured", new SpringConfiguredBeanDefinitionParser());
registerBeanDefinitionParser("mbean-export", new MBeanExportBeanDefinitionParser());
registerBeanDefinitionParser("mbean-server", new MBeanServerBeanDefinitionParser());
}
}
//WebApplicationContext
org.springframework.web.context.support.XmlWebApplicationContext
org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler
public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter implements BeanFactoryAware,
InitializingBean {
private List<HandlerMethodArgumentResolver> customArgumentResolvers;
private HandlerMethodArgumentResolverComposite argumentResolvers;
private HandlerMethodArgumentResolverComposite initBinderArgumentResolvers;
private List<HandlerMethodReturnValueHandler> customReturnValueHandlers;
private HandlerMethodReturnValueHandlerComposite returnValueHandlers;
private List<ModelAndViewResolver> modelAndViewResolvers;
private ContentNegotiationManager contentNegotiationManager = new ContentNegotiationManager();
private List<HttpMessageConverter<?>> messageConverters;
private WebBindingInitializer webBindingInitializer;
private AsyncTaskExecutor taskExecutor = new SimpleAsyncTaskExecutor("MvcAsync");
private Long asyncRequestTimeout;
private CallableProcessingInterceptor[] callableInterceptors = new CallableProcessingInterceptor[] {};
private DeferredResultProcessingInterceptor[] deferredResultInterceptors = new DeferredResultProcessingInterceptor[] {};
private boolean ignoreDefaultModelOnRedirect = false;
private int cacheSecondsForSessionAttributeHandlers = 0;
private boolean synchronizeOnSession = false;
private SessionAttributeStore sessionAttributeStore = new DefaultSessionAttributeStore();
private ParameterNameDiscoverer parameterNameDiscoverer = new LocalVariableTableParameterNameDiscoverer();
private ConfigurableBeanFactory beanFactory;
相关推荐
在本源码分析中,我们将探讨Spring MVC的工作原理、主要组件及其交互方式。 1. **DispatcherServlet**: 作为Spring MVC的前端控制器,DispatcherServlet是所有请求的入口点。它负责拦截请求,根据请求信息(如URL、...
本文将针对该版本的源码进行深入解读,帮助读者理解Spring的核心机制,提升对框架的运用能力。 1. **模块结构** Spring Framework主要分为五个核心模块:Core Container(核心容器)、Data Access/Integration...
二、源码解读 1. **ApplicationContext**:这是Spring的核心接口,负责初始化、加载配置文件,管理Bean的生命周期。源码中可以看到它是如何解析XML或Java配置,创建并管理Bean的。 2. **BeanFactory**:作为...
总结,Spring Framework 4.2.3.RELEASE的源码深度解读,能让我们更深入地理解其内部机制,从而更好地利用Spring构建高效、稳定的Java应用程序。无论是IoC容器的实现,还是AOP、MVC的原理,都是开发者在日常工作中不...
《Spring Framework 4 参考指南》中文翻译版是一份详尽解读Spring Framework 4的文档,旨在帮助中文用户深入理解和应用这一强大的Java应用程序开发框架。Spring Framework是Java开发领域中的核心工具,它提供了一个...
通过对Spring 5.0.8源码的深度解读,开发者不仅可以了解框架的工作原理,还能学习到设计模式、模块化开发、依赖管理等方面的最佳实践。这将有助于提升代码质量,降低项目风险,并为后续的Spring新版本升级打下坚实的...
本篇文章将聚焦于Spring Framework 4.1.0.RELEASE版本,探讨其主要特性、核心组件以及源码解读。 1. **主要特性** Spring 4.1.0.RELEASE引入了多个关键改进和新特性,包括: - **类型安全的`@RequestMapping`...
这份"spring 源码中文注释"包含了对Spring框架源码的详细解读,对于理解其工作原理、优化代码以及定制化开发具有重要意义。 首先,我们来看看Spring的核心组件——IoC容器。IoC容器是Spring的核心,它负责管理对象...
Spring 源代码分析系列涵盖了多个关键模块,包括事务处理、IoC容器、JDBC、MVC、AOP以及与Hibernate和Acegi安全框架的集成。以下是对这些知识点的详细阐述: 1. **Spring 事务处理**:Spring 提供了声明式事务管理...
Spring框架是Java开发中广泛应用的一个开源...总之,Spring源码解读是一项艰巨但极其有价值的任务,对于提升编程技巧和深入理解软件设计都有极大的帮助。作为"菜鸟",不要畏惧,逐步深入,你将收获满满的知识和经验。
九、源码解读的重要性 通过阅读Spring 3.2.10.RELEASE的源码,开发者可以更深入理解其设计思想,掌握核心功能的实现细节,这对于优化代码、排查问题、扩展功能具有重要意义。 总结,Spring Framework 3.2.10....
《Spring框架2.5.6深度解析》 ...通过对源码的深入解读,我们可以更透彻地理解Spring的核心机制,同时也能从中汲取经验,应用于现代的开发实践中。每日积累,逐步提升,Spring的世界等待着我们的探索。
这份【面试资料】-(机构内训资料)看透Spring MVC源代码分析与实践.zip文件很可能是为了帮助求职者准备相关面试问题而设计的,包含了对Spring MVC工作原理、关键组件和源码解读的详尽解析。 1. **Spring MVC基本...
三、源码解读 阅读Spring源码有助于深入理解其内部工作原理,例如: - BeanFactory的初始化过程,包括XML配置解析、BeanDefinition的加载和注册。 - AOP的实现机制,包括ProxyFactoryBean的创建、切面匹配策略以及...
本文将对这些源代码进行深入解读,帮助读者更好地理解和应用Spring框架的核心概念。 首先,让我们关注Spring框架的基础——依赖注入(Dependency Injection,简称DI)。Spring通过DI实现了对象之间的松耦合,使得...
本篇将聚焦于Spring的初代版本——Spring 1.0-rc1,通过对源码的深入解读,揭示其设计理念和核心功能,帮助读者理解Spring框架的基础架构和实现原理。 Spring 1.0-rc1是Spring框架发展的重要里程碑,它的代码量相对...
5. **MVC框架**:Spring MVC是Spring用于构建Web应用的模块,它提供了一个模型-视图-控制器架构。在源码中,`DispatcherServlet`是入口点,`Controller`接口定义了控制器行为,而`ViewResolver`负责解析视图。 6. *...
首先,SpringMVC是Spring框架的一个模块,主要负责处理HTTP请求和返回响应,它提供了模型-视图-控制器(MVC)架构模式,帮助开发者构建可维护的Web应用。在SpringMVC中,Controller接收请求,Service层处理业务逻辑...
Spring MVC源码深度剖析部分,将会详细解读Spring MVC框架的内部实现机制。核心组件如DispatcherServlet、HandlerMapping、HandlerAdapter等,每个组件的职责和如何相互协作,以及源码中对各种复杂场景的处理。 SSM...
这本书详细解读了Spring MVC和Spring WebFlux两大核心模块的源码,帮助读者理解Spring如何实现高效的Web应用开发。下面将根据标题、描述以及标签,深入探讨Spring MVC和Spring WebFlux的相关知识点。 一、Spring ...