- 博客(9)
- 收藏
- 关注
原创 权限判断Interception
网站鉴权拦截器验证登录package com.solo.manages.config;//实现spring提供的拦截器类public class InterceptorLogin implements HandlerInterceptor { private SlMenuMapper menuMapper; private SlManagerPermissionMapper managerPermissionMapper; private SlRolePermissi
2020-11-03 14:58:10 116
原创 kafka消费者幂等
使用redis加锁锁住消费消息@Component@Aspectpublic class IdempotencyAspect { @Autowired private RedisUtils redisUtils; private final Logger logger = LoggerFactory.getLogger(getClass()); @Pointcut("@annotation(com.solo.manages.annotation.Idempoten
2020-10-28 19:14:33 325
原创 延时队列的使用
延时队列实现的包装类其中addQueue负责往队列中添加延时任务添加后会把任务对象加入RDelayedQueue中,让监听器监听getQueue负责获得任务以及监听//当队列为空时挂起当前线程,不会消耗CPU//take去除队列中首位对象并获取这个对象,如果Queue为空则等待//然后让监听器执行这个对象的任务@Componentpublic class RedisDelayedQueue { private final static Logger LOGGER = LoggerF
2020-10-22 19:23:59 676
原创 初学Spring06
会话技术1.Cookie:客户端会话技术将数据保存在客户端本地,下一次请求会带着session返回快速入门:使用步骤:1.创建cookie对象,绑定数据new Cookie(String name, String value)2.发送cookie给浏览器,指定数据response.addCookie(Cookie cookie)3.获取cookie,拿到数据Cookie[] request.getCookies()客户端请求响应有一个set-cookie响应头保存到客户端浏览器下
2020-07-29 01:15:48 79
原创 初学Spring05
事务控制事务的隔离级别:三、MySQL事务隔离级别事务隔离级别 脏读 不可重复读 幻读读未提交(read-uncommitted) 是 是 是不可重复读(read-committed) 否 是 是可重复读(repeatable-read) 否 否 是 串行化(serializable) 否 否 否事务传播行为编程式事务控制三大对象:PlatformTransactionManagerTransactionDefin
2020-07-24 16:11:53 206
原创 初学Spring04
使用Spring AOP代理@RunWith(SpringJUnit4ClassRunner.class)@ContextConfiguration("classpath:ApplicationContext.xml")public class AopTest { @Autowired private TargetInterface target; @Test public void test1(){ target.save(); }}
2020-07-15 02:49:55 66
原创 初学Spring03
ApplicationContext实现类ClassPathXmlApplicationContext:直接引用resources文件路径下的配置文件FileSystemXmlApplicationContext:文件磁盘地址AnnotationConfigApplicationContextgetBean如果只有一个对象直接使用这个getBean(Class)多个用getBean(“id”)需要强转配置数据源数据源提高性能实例化数据源,初始化部分连接资源使用连接资源从数据源中获取
2020-07-13 02:58:46 80
原创 初学Spring 02
依赖注入除了对象的依赖,数组,集合等也可以在配置文件中注入依赖依赖注入分为set 和构造通常使用set方法注入依赖<bean id="userDao" class="com.Qing.dao.impl.UserDaoImpl" scope="singleton"> <property name="username" value="Qing"></property> <property name="age" value="18"
2020-07-12 01:10:55 67
原创 初学Spring 01
视频链接 https://www.bilibili.com/video/BV1WZ4y1H7du?p=10Spring 是目标为IOC AOP的Java 开源框架程序开发步骤:MVC 关系层configure 文件 关于Bean的使用<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://
2020-07-10 02:24:18 98
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人