随笔分类 - Spring boot
摘要:ActiveMQ介绍 MQ是消息中间件,是一种在分布式系统中应用程序借以传递消息的媒介,常用的有ActiveMQ,RabbitMQ,kafka。ActiveMQ是Apache下的开源项目,完全支持JMS1.1和J2EE1.4规范的JMS Provider实现。 特点: 1、支持多种语言编写客户端 2
阅读全文
摘要:主要是重写attemptAuthentication方法 导入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dep
阅读全文
摘要:<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.apac
阅读全文
摘要:导入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org
阅读全文
摘要:OAuth2简介 OAuth 是一个开放标准,该标准允许用户让第三方应用访问该用户在某一网站上存储的私密资源(如头像、照片、视频等〉,而在这个过程中无须将用户名和密码提供给第三方应用。实现这一功能是通过提供一个令牌( token ),而不是用户名和密码来访问他们存放在特定服务提供者的数据。每一个令牌
阅读全文
摘要:导入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupI
阅读全文
摘要:在SecurityConfig中加入 @Bean RoleHierarchy roleHierarchy(){ RoleHierarchyImpl roleHierarchy = new RoleHierarchyImpl(); String hierarchy ="ROLE_adb > ROLE_
阅读全文
摘要:创建数据库 SET FOREIGN_KEY_CHECKS=0; -- -- Table structure for role -- DROP TABLE IF EXISTS `role`; CREATE TABLE `role` ( `id` int(11) NOT NULL AUTO_INCREM
阅读全文
摘要:基本用法 创建项目,添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <g
阅读全文
摘要:项目创建 首先,来创建一个 Spring Boot 项目,引入 Cache 依赖: 工程创建完成后,引入 Ehcache 的依赖,Ehcache 目前有两个版本: 这里采用第二个,在 pom.xml 文件中,引入 Ehcache 依赖: <dependencies> <dependency> <gr
阅读全文
摘要:导入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-cache</artifactId> </dependency> <dependency> <groupId>o
阅读全文
摘要:entity public class Book { private Integer id; private String name; private String author; //get set tostring } 自己写一个Json文件 {"id": 99,"name": "红楼梦","a
阅读全文
摘要:导入依赖 application.properties spring.data.mongodb.host=127.0.0.1 spring.data.mongodb.authentication-database=admin spring.data.mongodb.username=root spr
阅读全文
摘要:在传统的单服务架构中,一般来说,只有一个服务器,那么不存在 Session 共享问题,但是在分布式/集群项目中,Session 共享则是一个必须面对的问题,先看一个简单的架构图: 在这样的架构中,会出现一些单服务中不存在的问题,例如客户端发起一个请求,这个请求到达 Nginx 上之后,被 Nginx
阅读全文
摘要:
阅读全文
摘要:  