随笔分类 - springBoot
摘要:1、基本目录结构 controller service impl mapper utils domain config interceoter(拦截器) dto
阅读全文
摘要:Spring MVC项目中页面重定向一般使用return "redirect:/other/controller/";即可。 而Spring Boot当我们使用了@RestController注解,上述写法只能返回字符串,解决方法如下:
阅读全文
摘要:springboot集合 父模块 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.3.RELEASE</vers
阅读全文
摘要:pom 添加到spring中 使用方法
阅读全文
摘要:import com.fasterxml.jackson.annotation.JsonIgnore; /** * 密码 */ @JsonIgnore private String password;
阅读全文
摘要:Spring提供了一个RestTemplate模板工具类,对基于Http的客户端进行了封装,并且实现了对象与json的序列化和反序列化,非常方便。RestTemplate并没有限定Http的客户端类型,而是进行了抽象,目前常用的3种都有支持: - HttpClient- OkHttp- JDK原生的
阅读全文
摘要:#SPRING CONFIG (ConfigFileApplicationListener) spring.config.name= # config file name (default to 'application') spring.config.location= # location of
阅读全文
摘要:spring Boot应用启动器基本的一共有44种,具体如下: 1)spring-boot-starter 这是Spring Boot的核心启动器,包含了自动配置、日志和YAML。 2)spring-boot-starter-actuator 帮助监控和管理应用。 3)spring-boot-sta
阅读全文
摘要:配置类相关: @PropertySource(value = "classpath:test.properties") //我们都把配置文件写到application.yml中。有时我们不愿意把配置都写到application配置文件中,这时需要我们自定义配置文件,比如test.properties
阅读全文
摘要:springboot给我们封装好了邮件功能,非常简单,只需要稍微配置下就ok。 引入jar <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactI
阅读全文
摘要:最近在使用spring-boot整合多模块,但是在父pom中打包maven install时总会报错:Failed to execute goal org.springframework.boot:spring-boot-maven-plugin,导致错误的原因是父pom.xml中引入了如下配置:
阅读全文
摘要:swagger是一个非常简单,强大的框架。快速上手,只需要引入jar包 , 使用注解就可以生成一个漂亮的在线api文档 pom.xml <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artif
阅读全文
摘要:以前我们在配置过滤器和拦截器的时候,都是一个类继承一个接口,然后在xml中配置一下就ok 但是,但是,这是springboot的环境,没有xml的配置。所以我们还要继续学习啊啊啊啊啊~~~~~ 先简单大致说明一下,过滤器我们可以直接在类上加上@Component注解实现,但是有些参数啥的还是不好配置
阅读全文
摘要:需求:一个父模块 下面几个子模块 其中一个模块是springboot结构。其他两个普通jar类型 有许多坑,都在注释里面写着呢。注意看父模块和demo模块的注释。 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.
阅读全文
摘要:springboot整合mybatis非常非常的简单,简直简单到发指。但是也有一些坑,这里我会详细的指出会遇到什么问题,并且这些配置的作用 整合mybatis,无疑需要mapper文件,实体类,dao层,数据库连接池。。。。。也就没了。 先放配置application.yml spring: dat
阅读全文
摘要:本博是在springboot下整合其他中间件,比如,mq,redis,durid,日志。。。等等 以后遇到再更。springboot真是太便捷了,让我们赶紧涌入到springboot的怀抱吧。 application.yml application-dev.yml 上面是一个总环境,一个开发环境,看
阅读全文