springboot工具类中读取配置文件1、创建配置文件(application.properties)spring.activemq.broker-url=tcp://localhost:61616spring.activemq.user=adminspring.activemq.password=adminspring.activemq.in-memory=truespring.activemq.pool.enabled=false2、创建工具类(PropertiesUtil.java)packagecom.jeff.utils;importjava.io.IOException;importjava.util.Properties;importorg.springframework.core.io.ClassPathRes...
继续阅读 >
分类:springboot工具类
2021
07-01
07-01
Springboot基础之RedisUtils工具类
SpringBoot整合Redis引入Redis依赖<!--redis--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-redis</artifactId></dependency>设置Redis的TemplateRedisConfig.javapackagecn.wideth.config;importorg.springframework.context.annotation.Bean;importorg.springframework.context.annotation.Configuration;importorg.springframework.data.redis.connection.R...
继续阅读 >