spring
Leftmumu
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
spring事务失效常见情况(一)
@Servicepublic class TestService { @Autowired private JdbcTemplate jdbcTemplate; @Autowired private TestService testService; @Transactional public void transaction1(){ jdbcTemplate.execute(); //这个方法是普通调用,不会走sp.原创 2022-02-17 13:56:42 · 298 阅读 · 0 评论 -
运行时动态修改@Scheduled注解的定时任务
@RestController@RequestMapping("api/v1/scheduler")public class TestController { @Autowired private ApplicationContext applicationContext; @GetMapping("/test") public String test(String sch) throws NoSuchFieldException, IllegalAccessExce.原创 2021-04-30 13:48:20 · 919 阅读 · 0 评论 -
springboot版本与spring framework版本对应关系
1.首先创建一个springboot项目,指定parent为<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.6.RELEASE</version></parent>2.声明<depend原创 2021-04-28 16:37:21 · 7212 阅读 · 3 评论 -
SpringBoot配置HTTPS,并实现HTTP访问自动转HTTPS访问
server: ssl: key-store: test.baidu.com.jks# key-store-type: PKCS12 key-store-password: 088w89ct8yoa# key-alias: tomcat key-password: 088w89ct8yoa启动类添加如下代码https://...转载 2019-02-12 14:51:30 · 677 阅读 · 0 评论 -
HandlerInterceptor
/* * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Y...转载 2018-05-28 00:14:52 · 292 阅读 · 0 评论 -
JDK动态代理和CGLIB代理的比较
1.如果需要代理的目标类没有实现任何接口,则ProxyFactoryBean会创建基于CGLIB的代理。这种情况是最容易的场景。因为jdk动态代理是基于接口的,因此没有实现接口就意味着jdk动态代理是不可能的。2.如果需要代理的目标类实现了一个或多个接口,则被创建的代理的类型跟ProxyFactoryBean的配置有关。如果ProxyFactoryBean的属性proxyTargetClass被设...翻译 2018-05-07 16:26:59 · 645 阅读 · 0 评论 -
spring杂谈
1.ApplicationContext默认在它启动的时候预先实例化singleton beans,这样就可以及时发现bean的依赖配置是否存在问题。可以修改这种默认行为,通过指定bean懒加载。@Lazy 或者<bean id="lazy" class="com.foo.ExpensiveToCreateBean" lazy-init="true"/>2.当某个bean和它所依赖的b...翻译 2018-05-17 17:06:23 · 170 阅读 · 0 评论 -
spring bean实例化的几种方式
1. Instantiation with a constructor2. Instantiation with a static factory method3. Instantiation using an instance factory method翻译 2018-05-17 15:29:05 · 252 阅读 · 0 评论
分享