随笔分类 -  springboot

摘要:https://blog.csdn.net/weixin_45131680/article/details/131561407 阅读全文
posted @ 2024-05-22 17:30 小泉哥 阅读(144) 评论(0) 推荐(0)
摘要:原贴:https://blog.csdn.net/wangchengaihuiming/article/details/95313482 package lct.conference.util; import com.imon.util.Encode; import org.dom4j.Docume 阅读全文
posted @ 2020-09-29 15:50 小泉哥 阅读(2409) 评论(0) 推荐(0)
摘要:<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>2.3.0.RELEASE</versi 阅读全文
posted @ 2020-08-17 19:58 小泉哥 阅读(628) 评论(0) 推荐(0)
摘要:原因分析见:https://www.cnblogs.com/pjjlt/p/10926398.html 解决办法:catch中手动回滚。 try { }catch (Exception e){ //手动回滚 TransactionAspectSupport.currentTransactionSta 阅读全文
posted @ 2020-08-05 19:12 小泉哥 阅读(641) 评论(0) 推荐(0)
摘要:https://www.cnblogs.com/winner-0715/p/10076832.html 阅读全文
posted @ 2020-07-31 10:14 小泉哥 阅读(305) 评论(0) 推荐(0)
摘要:https://www.jianshu.com/p/2a9b78e07d52 阅读全文
posted @ 2020-07-27 16:46 小泉哥 阅读(4483) 评论(0) 推荐(0)
摘要:@RestController注解,相当于@Controller+@ResponseBody两个注解的结合,返回json数据不需要在方法前面加@ResponseBody注解了,但使用@RestController这个注解,就不能返回jsp,html页面,视图解析器无法解析jsp,html页面。 阅读全文
posted @ 2020-07-27 16:44 小泉哥 阅读(439) 评论(0) 推荐(0)
摘要:@SpringBootApplication包含的三个注解及其含义 第一个:@SpringBootConfiguration(在这个类的源码中又有一个Configuration的注解) @Configuration这个注解的作用就是声明当前类是一个配置类,然后Spring会自动扫描到添加了@Conf 阅读全文
posted @ 2020-07-27 16:31 小泉哥 阅读(12275) 评论(0) 推荐(0)
摘要:<springProperty scope="context" name="logName" source="dubbo.application.name" defaultValue="default"/> <property name="log.path" value="${catalina.ba 阅读全文
posted @ 2020-07-22 15:57 小泉哥 阅读(3331) 评论(0) 推荐(0)
摘要:问题:前端vue+axios,后台springboot2.3+spring-session,为了解决跨域问题,前端已经设置了 axios.defaults.withCredentials = true; 后台也加了注解 @CrossOrigin(origins = "*", maxAge = 360 阅读全文
posted @ 2020-07-14 14:45 小泉哥 阅读(6267) 评论(0) 推荐(0)
摘要:TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); 阅读全文
posted @ 2020-07-01 00:40 小泉哥 阅读(1634) 评论(0) 推荐(0)
摘要:springboot拦截器导致@CrossOrigin失效。 原因: 1、CROS复杂请求时会首先发送一个OPTIONS请求做嗅探,来测试服务器是否支持本次请求,请求成功后才会发送真实的请求;而OPTIONS请求不会携带数据,导致这个请求被拦截了,直接返回了状态码,响应头中没携带解决跨域问题的头部信 阅读全文
posted @ 2020-06-19 16:32 小泉哥 阅读(6075) 评论(2) 推荐(2)
摘要:前端: axios.defaults.withCredentials = true; 后台: @CrossOrigin(origins = "*", maxAge = 3600,allowCredentials="true") 阅读全文
posted @ 2020-06-19 14:02 小泉哥 阅读(3034) 评论(2) 推荐(0)
摘要:webUrls: gray: 192.168.0.48:8123,192.168.0.49:8123 prod: 192.168.0.50:8123,192.168.0.51:8123 @Value("${webUrls.gray}") private String[] grayUrls; @Val 阅读全文
posted @ 2020-06-16 17:09 小泉哥 阅读(4280) 评论(0) 推荐(0)
摘要:package com.xxxxx.config.intercepters; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servl 阅读全文
posted @ 2020-06-11 16:19 小泉哥 阅读(463) 评论(0) 推荐(0)
摘要:package com.xxxxx.utils; import lombok.extern.slf4j.Slf4j; import org.apache.dubbo.config.ApplicationConfig; import org.apache.dubbo.config.ReferenceC 阅读全文
posted @ 2020-06-11 16:11 小泉哥 阅读(1282) 评论(0) 推荐(0)
摘要:使用@ModelAttribute注解的实体类接收前端发来的数据格式需要为"x-www-form-urlencoded", @RequestBody注解的实体类接收前端的数据格式为JSON(application/json)格式。 (若是使用@ModelAttribute接收application/ 阅读全文
posted @ 2020-06-05 14:06 小泉哥 阅读(947) 评论(0) 推荐(0)
摘要:切面打印日志时,参数序列化异常异常信息:java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyn 阅读全文
posted @ 2020-06-04 20:18 小泉哥 阅读(3233) 评论(0) 推荐(0)
摘要:当yml文件过长想根据业务划分的话,可以用以下配置, 引入拆分出去的配置文件 spring: profiles: include:filename 子配置文件名为application-filename.yml 补充多个子文件: spring: profiles: include: - filena 阅读全文
posted @ 2020-05-27 16:21 小泉哥 阅读(1646) 评论(0) 推荐(0)
摘要:解决方法: 加一个参数: serverTimezone=UTC jdbc:mysql://127.0.0.1:3306/springboot-dubbo01?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&failOverRead 阅读全文
posted @ 2020-05-26 18:44 小泉哥 阅读(7739) 评论(0) 推荐(0)