上述文章修改过后 偶尔打包编译完的项目jar包运行起来会给前台返回❓因为 WebMvcConfigurationSupport 会导致springboot的自动装配编码使用 ISO8859-1,所以我们在往前端扔中文时就乱码了所以我们需要向application.yml文件中指明字符编码为UTF-8server: tomcat: uri-encoding: UTF-8 spri...
1. 问题在使用Robot来模拟键盘事件时,启动报错java.awt.AWTException: headless environment at java.awt.Robot.<init>(Robot.java:91) at ro.qwq.script.utils.RobotUtil.aut_mobs(RobotUtil.java:18) at ro.qw...
1. 问题由于以前开发人员开发websocket相关模块的时候 继承了 WebSocketConfigurer 类, 重写了该类下面的 configureMessageConverters()方法 作用是解决响应头的content-type为UTF-8接下来看代码public class WebSocketConfig extends WebMvcConfigurerAdapter impl...
1. 问题使用MapStruct映射不同实体类属性的时候无法编译 提示报错No property named "xxx" exists in source parameter(s). Did you mean "null"2. 解决根据官网的提示 如果 Lombok >= 1.18.16则需要额外在编译检查里引入一个新的依赖 lombok-mapstruct-binding成功启动!
1. 问题由于业务拓展 公司项目迭代到Eureka分布式集群 以应对更多的吞吐量由于节点得向注册中心声明自己的host,每个节点的yml配置文件都不一样 打包发布起来比较麻烦需要一个一劳永逸的方案2. 解决方案2.1 SpringBoot配置文件读取优先级启动参数 -Dspring.config.location=xxxJar包同级目录的config目录Jar包同级目录classPath(即...
1. 问题前一阵子遇到的问题 突然想起来没有写笔记 先记录下来SpringBoot中使用 @ConfigurationProperties 注入对象 普通方法调用可以 在静态方法中调用的时候读取不到参数@Component @ConfigurationProperties(prefix = "constants.ftp") public class FtpConfig ...
1. 配置yml文件server: port: 8206 # 启用压缩配置 compression: # 是否启用 enabled: true # 配置压缩类型 mime-types: application/json,application/xml,text/xml,text/plain,text/html feign: httpcli...
import com.fasterxml.jackson.annotation.JsonIgnore; /** * 密码 */ @JsonIgnore private String password;
1. 解决办法 -> 增加注解错误信息:Controller:Service:正常情况下加上注解的类会自动被Spring扫描到生成Bean注册到spring容器中但是不知道为什么似乎这个service没有被扫描识别到那么问题的核心关键就在application类的注解SpringBootApplication上在application类上添加 注解并且手动配置他需要扫描的包@Compo...
若依数据权限若依数据权限是通过使用自定义注解,AOP拦截,实现将数据权限的sql插入Mapper文件中,从而达到控制数据权限的目的。使用数据权限,需要在功能中添加dept_id、user_id字段,并将mapper接口的入参设为继承了BaseEntity的实体对象。1. 数据权限过滤注解创建自定义注解,Target限定该注解仅用于方法上,共有两个参数,参数deptAlias对应的是需要部门权...