![](https://img-blog.csdnimg.cn/20200528101406540.jpg?x-oss-process=image/resize,m_fixed,h_224,w_224)
Spring boot
文章平均质量分 95
Spring boot相关技能
深巷的猫~
在挣扎的边缘徘徊中.......
展开
-
电商项目开发(持续更新中.....)
电商项目实战目录电商项目实战前言一、准备工作前言项目开发流程需求——原型图,需求文档Kick Off——产品,开发,测试,运维,运营,市场程序员——开发,设计,编码,测试员——测试,TC编写,测试,发布一、准备工作1.新建项目新建maven项目,修改父项目配置文件pom.xml,添加标签packing,属性值为pom,添加父项目spring boot配置<!--spring boot--> <parent> <groupId>原创 2022-01-10 18:50:38 · 651 阅读 · 0 评论 -
Type ‘java.awt.List‘ does not have type parameters.
Type ‘java.awt.List’ does not have type parameters.List<String> list = new ArrayList<String>();在使用 List 类的时候会报一个错误,如上所示,这个错误是因为导错了包,将import java.awt.List;改为import java.util.List;问题解决!!!...原创 2020-08-26 18:39:14 · 9373 阅读 · 2 评论 -
Could not autowire. No beans of ‘BookMapper‘ type found.
Could not autowire. No beans of ‘BookMapper’ type found.解决方法,在IDEA中设置一下,Settings - Editor - Inspections - Spring - Spring Core - Code - Autowiring for Bean Class - disable 把勾去掉即可,如下图:问题解决!!!...原创 2020-08-26 16:44:09 · 2220 阅读 · 0 评论 -
Not registered via @EnableConfigurationProperties, marked as Spring component.........
Not registered via @EnableConfigurationProperties, marked as Spring component, or scanned via @ConfigurationPropertiesScan.错误原因:当使用@ConfigurationProperties时IDEA顶部出现这样的提示:解决方法:@ConfigurationProperties使用spring-boot-configuration-processorjar 轻松地从带有注释的项目原创 2020-08-21 11:02:53 · 34601 阅读 · 7 评论 -
java.sql.SQLException: The server time zone value ‘�й���ʱ��‘ is unrecognized or represents more....
java.sql.SQLException: The server time zone value ‘�й���ʱ��’ is unrecognized or represents more than one time zone.错误原因:报错显示时区不对,可以通过配置JDBC驱动或者配置serverTimezone来设置时区,很明显,我们数据库驱动的时区配置不对,你得自己去配置或者去更换驱动的版本!<dependency> <groupId>mysql原创 2020-08-19 20:51:19 · 393 阅读 · 0 评论 -
Error creating bean with name ‘dataSource‘: Unsatisfied dependency expressed through field
Error creating bean with name ‘dataSource’: Unsatisfied dependency expressed through field ‘basicProperties’;解决方法:项目缺少了 springframework.jdbc 这个jar包,在pom.xml中添加依赖<dependency> <groupId>org.springframework.boot</groupId> <art原创 2020-08-19 20:39:03 · 12380 阅读 · 5 评论 -
Error:程序包com.sun.istack.internal不存在
程序包com.sun.istack.internal不存在出现该问题是因为代码里使用了 sun 私有包中 @NotNull注解导致,只要引入相应的sun私有包就OK解决措施:<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId>原创 2020-07-10 10:02:14 · 1531 阅读 · 0 评论 -
Web server failed to start. Port 8099 was already in use.
Web server failed to start. Port 8099 was already in use.Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2020-06-26 22:27:54.406 ERROR 12212 --- [ main] o.s.b.d.LoggingFailureAnal原创 2020-06-27 09:39:39 · 2127 阅读 · 0 评论 -
Failed to bind properties under ‘spring.datasource.type’ to java.lang.Class的解决方法
问题详情如下:Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2020-06-04 8:27:01.386 ERROR 11568 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter : ***************************APPL原创 2020-06-04 14:03:22 · 23957 阅读 · 4 评论 -
Failed to configure a DataSource:‘url’attribute is not specified and no embedded的解决方法
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.Reason: Failed to determine a suitable driver class问题具体如下:Error starting ApplicationContext. To display the conditions report re-run your .原创 2020-06-03 22:17:23 · 512 阅读 · 0 评论 -
Spring boot整合视图技术(FreeMarker)
FreeMarker是非常古老的引擎,可以用在Web环境或非Web环境下,与Thymeleaf相比,FreeMarker需要经过解析才能够在浏览器中展示出来。FreeMarker不仅可以用来配置HTML页面模板,也可以作为电子邮件模板、配置文件模板及源码模板等。Spring boot整合FreeMarker步骤如下:1、创建项目,添加依赖 <dependency> <groupId>org.springframework.boot</groupId&原创 2020-08-26 09:20:00 · 181 阅读 · 0 评论 -
CORS支持
CORS(Cross-Origin Resource Sharing)是由W3C制定的一种跨域资源共享技术标准,其目的就是为了解决前端的跨域请求,且CORS支持多种HTTP请求方式。在Spring boot中配置CORS步骤如下:1、创建Spring boot项目,添加Web依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>原创 2020-08-25 10:01:37 · 496 阅读 · 0 评论 -
Spring boot整合视图技术(Thymeleaf)
Thymeleaf支持HTML原型,既可以让前端工程师在浏览器中直接打开查看样式,也可以让后端工程师结合真实数据产看显示效果。同时,Spring boot提供了Thymeleaf自动化配置解决方案,因此在Spring boot中使用Thymeleaf非常方便。Spring boot整合Thymeleaf步骤如下:1、新建一个Spring boot项目,在pom.xml中添加依赖<dependency> <groupId>org.springframewor原创 2020-08-21 16:12:17 · 252 阅读 · 0 评论 -
Springboot集成Swagger2
Springboot集成Swagger1、配置文件pom.xml中添加依赖<dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.9.2</version></dependency><dependency>原创 2020-07-20 13:05:04 · 150 阅读 · 0 评论 -
多数据源(Springboot)
多数据源1、关键类:ThreadLocal:线程局部变量,所谓线程局部变量,就是仅仅只能被本线程访问,不能在线程之间进行共享访问的变量AbstractRoutingDataSource:getConnection()根据查找lookup key键对不同目标源的调用,通常是通过(但不一定)某些线程绑定的事务上下文来实现2、实现多数据源步骤:步骤1:在Springboot中,增加多数据的配置步骤2:扩展Spring的AbstractRoutingDataSource抽象类,AbstractRouti原创 2020-07-03 11:37:42 · 6884 阅读 · 0 评论 -
校验模式(Hibernate validatior)
校验模式1、校验模式分类(1)普通模式:会校验完所有的属性,然后返回所有的验证失败信息(2)快速失败返回模式:只要有一个验证失败,则返回2、校验注解@Null 被注释的元素必须为null@NotNull 被注释的元素不能为null@NotEmpty 验证注解元素值不为null且不为空(字符串长度不为0、集合大小不为0)@NotBlank 验证注解的元素值不为空(不为null、去除首位空格后长度为0)@AssertTrue 被注释的元素必须为true@AssertFalse 被注释的元素原创 2020-06-30 08:38:02 · 1526 阅读 · 0 评论 -
Spring事件(+案例)
Spring事件1、关键类:ApplicationEvent:事件源ApplicationListener:编码式事件监听及处理(业务逻辑处理)@EventListener:注解式事件监听及处理ApplicationContext:spring容器,用于发布事件2、遵循流程:自定义事件,继承ApplicationEvent定义监听事件,实现ApplicationListener定义消息,发到容器中,使容器触发事件发布事件,使用ApplicationContext发布事件3、异步处理默原创 2020-06-29 15:51:15 · 479 阅读 · 0 评论 -
Springboot配置模式(+实例)
Springboot装配(配置)方式1、手动装配(1) 模式注解装配:@Controller、@Service、@Repository等Component注解的拓展,Configruation(2) Enable模块装配,常用如下:@EnableWebMvc WebMvc模式@EnableTransaction Management事务管理模块@EnableCaching Caching模块@EnableAutoConfiguration原创 2020-06-27 17:24:03 · 502 阅读 · 0 评论 -
初步认识Springboot
认识Springboot1、Springboot的由来 其设计目的为了简化spring应用的初始搭建过程和开发过程,该框架使用了特定的方式来进行配置(提供了默认的代码和注释配置),使开发人员不需要定义样板化的配置。2、Springboot的特点可快速构建独立的spring应用程序 Springboot所创建的应原创 2020-06-26 15:54:18 · 334 阅读 · 0 评论 -
认识IOC与AOP(Spring)
1、 控制反转(Inversion of Control,简称IOC):也称为依赖注入,是面向对象编程中的一种设计理念,用来降低程序代码之间的耦合度。 扩展: 程序的耦合:调用者与被调用者的依赖关系企业开发的原则:“编译时不依赖,运行时才依赖”// 所谓的A类依赖B类public class PersonServiceBean{ private PersonDao personDao=new PersonDaoBean(); public void save(Pers.原创 2020-06-10 13:57:11 · 153 阅读 · 0 评论 -
Springboot项目注解详解
使用注解的优势:采用纯java代码,不在需要配置繁杂的xml文件在配置中也可享受面向对象带来的好处类型安全对重构可以提供良好的支持减少复杂配置文件的同时亦能享受到springIoC容器提供的功能一、注解详解1、@SpringBootApplication:申明让spring boot自动给程序进行必要的配置,这个配置等同于:@Configuration ,@EnableAutoConfiguration 和 @ComponentScan 三个配置。@Configuration :等同于spri原创 2020-06-04 17:10:06 · 377 阅读 · 0 评论 -
搭建Springboot项目流程
一、创建Springboot项目二、搭建数据库环境在本地新建数据库,创建表结构二、SpringBoot集成Mybatis-plus1、pom.xml添加依赖2、在application-dev.yml文件中,配置mybatis-plus,还要配置数据源及数据库连接参数3、代码部分,包括entity、dao、service、serviceImpl和controller5个类以及resource里面对应的.xml文件4、测试三、Springboot集成Swagger1、pom.xml添加依赖原创 2020-05-28 10:04:10 · 605 阅读 · 0 评论 -
Springboot的entity,dao,service,controller层级理解
1、Entity层:实体层,数据库在项目中的类 主要用于定义与数据库对象应的属性,提供get/set方法,tostring方法,有参无参构造函数。2、Dao层:持久层,主要与数据库交互 DAO层首先会创建Dao接口,接着就可以在配置文件中定义该接口的实现类;接着就可以在模块中调用Dao的接口进行数据业务的处理,而不用关注此接口的具体实现类是原创 2020-05-28 09:43:47 · 1104 阅读 · 0 评论