![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java
文章平均质量分 66
itCrazyJun
https://gitee.com/tinyhome/quick
展开
-
浅谈springboot异常处理机制
项目中对于全局的异常处理是非常有必要的,对用户来说体验可以更加友好,对系统来说可以追溯异常信息,找到异常出处。 springboot中又是如何处理异常的呢? spring 中有一个处理异常的接口public interface HandlerExceptionResolver { ModelAndView resolveException(原创 2018-01-12 15:08:44 · 9242 阅读 · 3 评论 -
springboot定时任务处理
定时任务是一种很常见的应用场景,springboot中的定时任务完全用的spring的那一套,用起来比较简单,需要注意的是线程池配置的那一块 使用 @EnableScheduling 注解就可以开启定时任务@Target(ElementType.TYPE)@Retention(RetentionPolicy.RUNTIME)@Import(SchedulingConfi原创 2018-01-15 18:19:12 · 2994 阅读 · 0 评论 -
SpringApplicationRunListener 解析
SpringApplicationRunListener 作用 SpringApplicationRunListener 可以监听springboot应用启动过程中的一些生命周期事件,并做一些处理 查看SpringApplicationRunListener 定义 /** * Called immediately when the run me原创 2018-01-26 23:49:34 · 3627 阅读 · 0 评论 -
基于Java阻塞队列实现生产者与消费者模式
java 阻塞队列实现生产者与消费者模式 public class BlockingTest { public static void main(String[] args) { ArrayBlockingQueue<Integer> arrayBlockingQueue = new ArrayBlockingQueue<Inte...原创 2018-03-04 12:40:39 · 523 阅读 · 0 评论 -
Shiro 自定义登录方式,非密码方式
主要绕过密码匹配,代码如下 ··· @Component public class MyHashedCredentialsMatcher extends HashedCredentialsMatcher {@Overridepublic boolean doCredentialsMatch(AuthenticationToken token, Authentic...原创 2018-06-11 01:25:18 · 1961 阅读 · 0 评论 -
基于Shiro框架做日活统计
基于Shiro框架做日活统计 基本思想是,通过记录成功登陆的日志来做统计分析,通过使用shiro的过滤器链体系来记录账号和密码登陆或自动登陆的日志插入第一步,写一个过滤器,继承自 UserFilter,重写 isAccessAllowed 方法,如下··· package io.jcwl.modules.sys.shiro;import io.jcwl.common.c...原创 2018-08-02 12:00:21 · 605 阅读 · 0 评论