
spring
风行傲天
这个作者很懒,什么都没留下…
展开
-
spring boot 统一处理敏感词
1、初始化 词库信息package com.common.sensitiveword;import lombok.extern.slf4j.Slf4j;import org.springframework.util.ResourceUtils;import java.io.*;import java.util.*;import java.util.concurrent.ConcurrentHashMap;import java.util.regex.Matcher;import...原创 2020-10-20 15:45:44 · 4874 阅读 · 0 评论 -
spring 获取bean
import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.springframework.beans.factory.DisposableBean;import org.springframework.context.ApplicationContext;import org.springframework.context.ApplicationContextAware;import org.springframewo...原创 2021-10-14 09:52:49 · 116 阅读 · 0 评论 -
servlet中使用spring
在讲之前,我们先来看看spring配置文件中为Servlet注入到底能不能成功。首先,写一个随服务器启动的Servlet,Servlet中定义一个类变量,并定义set方法。随便在set方法中向控制台输出些东西,然后在doGet,doPost或service方法中调用该类对象的一个方法。配置好配置文件,启动服务器。仔细观察控制台,我们发现Servlet启动过程中已经执行了set方法,说明改servl转载 2012-08-03 10:20:52 · 954 阅读 · 0 评论 -
spring-boot aop 访问权限
使用spring-boot aop处理访问权限spring-boot 2.0.11、pom.xml 添加aop-starter<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</a...原创 2018-12-28 18:16:43 · 1035 阅读 · 0 评论 -
springboot mybatis 配置多数据源
1、在application.properties添加数据源配置# 配置多数据源spring.datasource.db1.url=jdbc:mysql://127.0.0.1:3306/test1spring.datasource.db1.username=rootspring.datasource.db1.password=admin# 使用druid数据源spring.dat...原创 2019-05-17 09:43:43 · 208 阅读 · 0 评论 -
springboot 配置多环境使用yml配置 @profileActive@ 启动报错Do not use @ for indentation
yml配置文件中添加了下面配置spring: profiles: active: @profileActive@启动会报错:@profileActive@ 启动报错Do not use @ for indentation解决办法:一、需要在pom文件中添加以下代码<plugin> <groupId>org.apache....原创 2019-07-04 15:17:38 · 12474 阅读 · 0 评论 -
springboot 配置 jjwt
JWT全名JSON WEB Token主要作用为用户身份验证, 广泛应用与前后端分离项目当中. JWT 的优缺点 :https://www.jianshu.com/p/af8360b83a9f一、pom.xml 引入jar文件 <dependency> <groupId>io.jsonwebtoken&...原创 2019-08-09 13:55:58 · 1791 阅读 · 0 评论