上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 121 下一页
摘要: 最近学习Spring,一直不太明白Srping的切面编程中的的argNames的含义,经过学习研究后,终于明白,分享一下 先看一个例子: 需要监控的类: package bean; public class HelloApi { public void aspectTest(String a,Str 阅读全文
posted @ 2020-11-04 15:44 与f 阅读(372) 评论(0) 推荐(0)
摘要: 给Advice传递参数 Advice除了可以接收JoinPoint(非Around Advice)或ProceedingJoinPoint(Around Advice)参数外,还可以直接接收与切入点方法执行有关的对象,比如切入点方法参数、切入点目标对象(target)、切入点代理对象(this)等。 阅读全文
posted @ 2020-11-04 15:33 与f 阅读(4446) 评论(0) 推荐(1)
摘要: 上一篇文章《Spring AOP 面向切面编程入门》对AOP作了简要的介绍,包含一些专业术语的解释。 本文基于SpringBoot编写了一个简单的Spring AOPDemo。 maven依赖添加如下 <!--引入SpringBoot的Web模块--> <dependency> <groupId>o 阅读全文
posted @ 2020-11-03 16:53 与f 阅读(246) 评论(0) 推荐(0)
摘要: 说起spring,我们知道其最核心的两个功能就是AOP(面向切面)和IOC(控制反转),这边文章来总结一下SpringBoot如何整合使用AOP。 一、示例应用场景:对所有的web请求做切面来记录日志。 1、pom中引入SpringBoot的web模块和使用AOP相关的依赖: 其中:cglib包是用 阅读全文
posted @ 2020-11-03 16:41 与f 阅读(261) 评论(0) 推荐(0)
摘要: 1、创建多线程和线程池的代码: import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; int threadSi 阅读全文
posted @ 2020-11-03 14:58 与f 阅读(892) 评论(0) 推荐(0)
摘要: 我的错误是在:在多线程并发测试service读库,redis缓存被穿透的情况下遇到的! 异常信息 Exception in thread "task-2" java.lang.IllegalStateException:EntityManagerFactory is closed 错误原因:serv 阅读全文
posted @ 2020-11-03 11:37 与f 阅读(3030) 评论(0) 推荐(0)
摘要: 代码: import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframewor 阅读全文
posted @ 2020-11-02 10:10 与f 阅读(1622) 评论(0) 推荐(0)
摘要: 最近使用spring-data-redis RedisTemplate 操作redis时发现存储在redis中的key不是设置的string值,前面还多出了许多类似\xac\xed\x00\x05t\x00这种字符串,如下 127.0.0.1:6379> keys * 1) "\xac\xed\x0 阅读全文
posted @ 2020-11-01 10:06 与f 阅读(2163) 评论(0) 推荐(0)
摘要: 1、如图所示,mysql中存在一个字段create_time,其数据类型为datetime; 2、对应的实体类 public class RealAuthDO implements Serializable { private static final long serialVersionUID = 阅读全文
posted @ 2020-10-30 16:29 与f 阅读(3569) 评论(0) 推荐(0)
摘要: package com.sxt.utils.date1; import java.util.Date; import java.text.DateFormat; import java.text.SimpleDateFormat; /* * 日期格式化类(必须掌握) * API: * G Era 标 阅读全文
posted @ 2020-10-30 16:22 与f 阅读(648) 评论(0) 推荐(0)
上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 121 下一页