SpringFramework的版本4.3.x.RELEASE. Reference SpringFramework源码 (adsbygoogle = window.adsbygoogle || []).push({});
本来RequestBodyAdvice和ResponseBodyAdvice是成对一起的,这里先分析RequestBodyAdvice.
图1 ServletContext接口的方法
今天在看Springsecurity(4.3.x.RELEASE)的WebSecurityConfiguration时,看到AnnotationAwareOrderComparator,就写下自己的感受。
-- Shared version number properties --> 002 <properties> 003 <org.springframework.version>3.0.5. RELEASE</org.springframework.version> 004 </properties> 005 006 <! */org.springframework.util.*) 009 --> 010 <dependency> 011 <groupId>org.springframework</groupId> 012 <artifactId>spring-core</artifactId> 013 <version>${org.springframework.version}</version> */org.springframework.dao.*) 070 --> 071 <dependency> 072 <groupId>org.springframework</groupId>
} } /** * Determine whether the supplied {@link AdvisedSupport} has only the * {@link org.springframework.aop.SpringProxy
ReflectiveMethodInvocation是AOP中一个重要的类,这个类在JdkDynamicAopProxy的invoke方法中使用到它,如下的List-1
public String hello() { System.out.println("service的hello方法"); return "Hello"; } } import org.springframework.aop.MethodBeforeAdvice target) throws Throwable { System.out.println("beforeAdvice的before方法"); } } import org.springframework.aop.AfterReturningAdvice System.out.println("AfterAdvice的afterReturning方法"); } } import org.junit.Test; import org.springframework.aop.framework.ProxyFactory
JdkDynamicAopProxy中使用到了拦截器链,如下List-1,advised是ProxyFactory,而方法getInterceptorsAndDynamicInterceptionAdvice则是在其父类AdvisedSupport中。
tomcat启动停止到这: Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
ReflectiveAspectJAdvisorFactory这个类,个人觉得是Spring aop的一个核心类。如下List-1所示,ReflectiveAspectJAdvisorFactory间接实现了AspectJAdvisorFactory。
AnnotatedBeanDefinitionReader没有继承任何类。
Springboot的版本2.0.5.release 先上代码吧,如下List-1 List-1 import org.springframework.context.annotation.Bean ; import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration Condition是在什么地方被调用呢,在org.springframework.context.annotation.ConditionEvaluator中,如下List-2 List-2 public
图1
SpringFramework版本是5.1.9 List-1 @Controller public class UserController { @RequestMapping("/
List-2 package org.springframework.context.annotation; import org.springframework.core.type.AnnotatedTypeMetadata ; import org.springframework.util.MultiValueMap; /** * @author Chris Beams * @author Phillip Webb
Springboot中,对mvc进行自动化配置时在WebMvcAutoConfiguration中会自动注入InternalResourceViewResolver(渲染jsp的)、BeanNameViewResolver、ContentNegotiatingViewResolver。
DispatcherServlet默认情况下,使用了BeanNameUrlHandlerMapping和RequestMappingHandlerMapping,见DispatcherServlet.properties中org.springframework.web.servlet.HandlerMapping
org.springframework.beans.NotWritablePropertyException 关于 org.springframework.beans.NotWritablePropertyException 解决办法 ---- 在配置spring环境的时候莫名其妙的弹出一个错误, org.springframework.beans.NotWritablePropertyException, 当时我就郁闷了
是一个技术生态体系,是集大成者。它包含了Spring Framework、Spring Boot、Spring Cloud等(还包括Spring Cloud data flow、spring data、spring integration、spring batch、spring security、spring hateoas),可以参考链接:https://spring.io/projects 下图为部分内容。