摘要:
3. 修改启动类 为继承 SpringBootServletInitializer 4. 重写启动类的 configure方法,方法中return builder.sources(XXX.class); //XXX为自己的启动类 5. clean 项目 6. install项目 阅读全文
摘要:
WebMvcConfigurerAdapter is deprecated 继承的方式已经被弃用了 直接实现 WebMvcConfigurer类即可 阅读全文
摘要:
1. 使用@EnableAsync开启异步 2. 定义@Component`, 方法上使用@Async作为组建让容器扫描执行 使用场景: 发送短信 发送邮件 App消息推送 阅读全文
摘要:
SpringBoot定时任务 项目开发中经常需要执行一些定时任务,比如需要在每天凌晨时候,分析一次前一天的日志信息。Spring为我们提供了异步执行任务调度的方式,提供TaskExecutor 、TaskScheduler 接口。 1. 启动类添加@EnableScheduling注解 2.建立定时 阅读全文
摘要:
作用:资源文件中的配置属性映射到实体类属性 1.引入包 2. 创建一个properties文件resource.properties 3. 创建Resource.java 4. 需要使用的地方使用 自动装配 @Autowired private Resource resource; 阅读全文
摘要:
1. 创建项目的两种方式: 使用官方地址生成项目:https://start.spring.io/ 使用STS 2. 使用@RestController注解 3.字段的返回 @JsonIgnore 不会返回到前端 @JsonFormat 格式化信息 @JsonInclude 设置条件是否包含信息(是 阅读全文
摘要:
2018-5-28 19:25:26 oracle.sysman.emcp.util.PlatformInterface executeCommand配置: 系统找不到文件 C:\windows\regedit.exe。Creating registry entries failed. Aborti 阅读全文
摘要:
The type WebMvcConfigurerAdapter is deprecated WebMvcConfigurerAdapter 被弃用了,看一下文档。 可以采用直接实现WebMvcConfigurer接口的方式,而不用使用WebMvcConfigurerAdapter 阅读全文
摘要:
springboot的特点 如何启动springboot应用 Eclipse中安装有sts插件情况下右键使用 run as -> springboot app 3. 使用maven管理的项目,先使用 mvn install 构建以后,再进入项目 的target目录中使用 阅读全文
摘要:
使用Eclipse搭建springboot的过程中出现了这个问题: java.lang.NoClassDefFoundError: org/springframework/core/env/EnvironmentCapab 1.还是考虑 读取D:\JAVA\maven\repository\org\ 阅读全文