![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Spring Boot
文章平均质量分 66
猿有一技
互联网、技术、娱乐分享
展开
-
jar包读取资源文件报错:找不到资源文件(No such file or directory)
1、遇到问题(1)Maven项目开发阶段正常运行,Java程序可以读取配置文件public class Main { public static void main(String[] args) throws Exception { Main.readFile("resources/sharepointApp.xml"); } public static byte[] readFile(String fileName) throws Exception {转载 2021-04-08 15:43:16 · 2664 阅读 · 0 评论 -
SpringBoot 枚举痛点 org.springframework.validation.BeanPropertyBindingResult
如果变量值仅有有限的可选值,那么用枚举类来定义常量是一个很常规的操作。但是在业务代码中,我们不希望依赖ordinary()进行业务运算,而是自定义数字属性,避免枚举值的增减调序造成影响。@Getter@AllArgsConstructorpublic enum CourseType { PICTURE(102, "图文"), AUDIO(103, "音频"), VIDEO(104, "视频"), ; private final int index..转载 2021-04-07 17:06:58 · 1681 阅读 · 0 评论 -
spring cloud 集成 nacos
本文介绍spring cloud 集成 nacos案例官方文档:https://nacos.io/zh-cn/docs/what-is-nacos.html](https://nacos.io/zh-cn/docs/what-is-nacos.html单机部署:1.git克隆项目git clone https://github.com/alibaba/nacos.git2.进入根目录cd nacos/3.maven编译mvn -Prelease-nacos clean install -U原创 2020-10-17 12:10:25 · 433 阅读 · 0 评论 -
SpringDataJpa——JpaRepository查询功能
原文链接:http://blog.csdn.net/ming070423/article/details/220861691.JpaRepository支持接口规范方法名查询。意思是如果在接口中定义的查询方法符合它的命名规则,就可以不用写实现,目前支持的关键字如下。KeywordSampleJPQL snippetIsNotNullfindByAgeNotNull... where x.age ...转载 2018-04-03 15:39:38 · 649 阅读 · 0 评论