自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

黎子爱发呆博客

记录开发学习日常

  • 博客(10)
  • 收藏
  • 关注

原创 spring logging 日志配置

logging: level: org.springframework.web: INFO #mybatis-plus包路径 com.demo.mybatisplus: DEBUG #项目包路径 com.demo.mybatisplus: DEBUG

2019-10-26 14:59:44 263

原创 The Tomcat connector configured to listen on port 8761 failed to start...(端口占用)

原因8761端口被占用解决方法首先输入netstat -ano命令查找所有端口其次:找到8761端口对应的PID,输入tasklist | findstr "9784"查找进程最后结束进程:taskkill /f /t /im java.exe...

2019-10-16 15:24:03 1257

原创 RequestBodyAdvice和ResponseBodyAdvice接口

接口源码 //ResponseBodyAdvice接口 public interface ResponseBodyAdvice<T> { boolean supports(MethodParameter var1, Class<? extends HttpMessageConverter<?>> var2); ...

2019-10-12 15:14:36 1376

原创 @RestControllerAdvice/@ControllerAdvice

介绍@RestControllerAdvice/@ControllerAdvice是@Component的强化版,是spring mvc提供的功能,在spring boot可以直接使用。 使用该注解的类可以拥有@ExceptionHandler, @InitBinder或 @ModelAttribute注解的方法,并且这些方法会被应用到控制器类层次的所有的@RequestMapping方法上。...

2019-10-12 12:05:00 243

原创 使用RedisTemplate对redis进行独写操作

添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <!--非本地连接redis...

2019-10-11 17:01:40 252

原创 POI导出数据为Excel格式(XSSF)(内省方式加反射)

代码package com.zanclick.zyjk.common.utils;import org.apache.poi.xssf.usermodel.*;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import javax.swing.fil...

2019-10-10 18:36:20 577

翻译 Mybatis-plus 系列之代码生成器(Mybatis-plus -generator)

public class MyCodeGenerator{ /** * * 读取控制台内容 * */ /* public static String scanner(String tip) { Scanner scanner = new Scanner(System.in); StringBuilder hel...

2019-10-10 12:10:23 424

原创 @Transactional(rollbackFor = Exception.class)

原因只要出现异常就实现回滚,不管时RuntimeException还是非运行时异常。主要时为了保证数据的一致性,不影响正常数据的执行。@Transactional(rollbackFor = Exception.class)在操作数据时发生,想插入,修改,删除等。使用在service是实现类上。代码:@Override@Transactional(rollbackFor = Except...

2019-10-08 16:09:17 761

原创 java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @Context

产生原因是因为测试类没有写在启动目录下,测试类要放在启动目录下,就是application.class同级测试类完整代码import com.zanclick.zyjk.core.modules.entity.Merchant;import com.zanclick.zyjk.core.modules.mapper.MerchantMapper;import org.junit.Ass...

2019-10-08 13:46:07 279

原创 SpringBoot整合Swagger2,Swagger2的简单使用

1.配置类public class Swagger2Config(){ public Docket createRestApi(){ return new Docket(DocumentationType.SWAGGER2) //创建该Api接口的基本信息,这些信息都会显示在文档页面 .apiInfo(apiInfo()) //调用该方法ApiSelectorBu...

2019-10-08 10:33:11 556

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除