![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
springboot
文章平均质量分 51
wit_cx
这个作者很懒,什么都没留下…
展开
-
使用spring validation + jsr303 对复杂对象入参进行校验
https://blog.csdn.net/ahao_henrry/article/details/92403008转载 2021-05-18 13:53:59 · 318 阅读 · 0 评论 -
SpringBoot - 如何实现自定义注解 @Target、@Retention、@Documented 注解的简介
@Target注解功能:指明了修饰的这个注解的使用范围,即被描述的注解可以用在哪里。ElementType的取值包含以下几种:TYPE:类,接口或者枚举FIELD:域,包含枚举常量METHOD:方法PARAMETER:参数CONSTRUCTOR:构造方法LOCAL_VARIABLE:局部变量ANNOTATION_TYPE:注解类型PACKAGE:包@Retention注解功能:指明修饰的注解的生存周期,即会保留到哪个阶段。RetentionPolicy的取值包含以下三种转载 2021-01-24 13:45:07 · 458 阅读 · 0 评论 -
SpringBoot配置mysql5和mysql8的数据源
mysql 8必须加时区serverTimezone,不然启动回报错注意yml文件的分层书写<span style="color:#000000"><code class="language-yaml"> <span style="color:#c678dd">datasource</span><span style="color:#999999">:</span> <span style="color:#转载 2020-11-15 17:00:58 · 873 阅读 · 0 评论 -
SpringBoot使用Validation校验参数
JSR(Java Specification Requests)是Java界的重要标准;JSR又细分很多标准,其中JSR303就代表Bean Validation。更多细节可参考:https://jcp.org/en/jsr/detail?id=303。目录准备工作约束性注解(简单)说明@Validated的使用时机@Validated与@Valid的简单对比说明自定义注解对注解抛出的异常进行处理欢迎来到JustryDeng的博客!正文start!准备工作引入相关依赖转载 2020-10-04 23:27:16 · 607 阅读 · 0 评论 -
初步搭建springboot应用,报错:Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedd
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.翻译就是:无法配置DataSource:未指定'url'属性,也无法配置嵌入数据源。很明显,就是你在应用中没有配置datasource的一些相关属性,例如:地址值啊,数据库驱动啊,用户名啊,密码啊,都知道,SpringBoot的最大一个好处就是自动配...转载 2020-10-04 22:29:08 · 63 阅读 · 0 评论 -
2.3.4.RELEASE org.junit.runners.model.InvalidTestClassError: Invalid test class ‘com.student.validat
主要pom文件<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <!--<exclusions>--> <!--<exclusion>--&原创 2020-10-04 21:30:39 · 165 阅读 · 0 评论 -
2.2.6.RELEASE版本的springboot 单元测试报错 java.lang.NoClassDefFoundError: org/junit/platform/engine/support/
新建了一个2.2.6.RELEASE版本的springboot项目,在用单元测试的时候,发现没有@RunWith注解,于是,就添加了<dependency><groupId>junit</groupId><artifactId>junit</artifactId><scope>test</scope></dependency>好,现在有这个注解了,运行测试方法,报错java.l.转载 2020-10-04 21:23:37 · 773 阅读 · 0 评论