springboot
follow_me!
机会只会留给有准备的人
展开
-
java实现文件加密解密
异或加密,支持所以类型文件原创 2022-11-14 16:51:23 · 9166 阅读 · 6 评论 -
获取系统参数System.getProperties()与配置文件参数@Value(“${key}“)
获取所有系统参数可以使用`System.getProperties()`,获取单个系统参数可以使用`System.getProperty("param1")`;默认的系统参数如下System.getProperties()`无法获取配置文件上的参数,配置文件上的参数可通过@Value("${key}")获取:原创 2022-11-14 16:01:35 · 2222 阅读 · 0 评论 -
设置日志打印级别:
springboot的jar包里有人设置了debug级别,导致日志很多,可以在java -jar重起时设定日志级别。原创 2022-10-24 16:29:52 · 2070 阅读 · 0 评论 -
无法使用引入jar包中的Bean的问题
问题:在A项目中使用@Configuration+@Bean、@Component、@Service、@Controller、@Mapper、@Repository等注解注入的类,打包成jar后引入B项目就无法用@Autowired自动注入解析问题:因为SpringBoot自动扫描的默认路径是主启动类所在的包及其子包,如果jar包中的bean的路径不包含在内,就不会被扫描,因此无法用@Autowired自动注入解决方法:解决方法1:@SpringBootApplication设置参数:scanB原创 2021-11-24 11:12:55 · 4581 阅读 · 0 评论 -
postman模拟上传文件(MultipartFile)
一、后台方法:二、postman:1.打开postman,新建接口,按图示顺序,选择post请求、输入url、选择body、选form-data2.按下图的顺序:选择file类型参数、选择一个文件、输入key(key应于后台参数一致),点击sent即可...原创 2021-10-16 15:05:22 · 9023 阅读 · 0 评论 -
springboot监控管理
一、使用1.pom引入actuator依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> <version>2.5.2</version> <原创 2021-09-02 22:35:15 · 60 阅读 · 0 评论 -
springboot 邮件任务
一、使用1.pom引入spring-boot-starter-mail <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId> </dependency>2.yml3.主启动普通,没什么特原创 2021-08-30 23:19:02 · 86 阅读 · 0 评论