上述文章修改过后 偶尔打包编译完的项目jar包运行起来会给前台返回❓因为 WebMvcConfigurationSupport 会导致springboot的自动装配编码使用 ISO8859-1,所以我们在往前端扔中文时就乱码了所以我们需要向application.yml文件中指明字符编码为UTF-8server: tomcat: uri-encoding: UTF-8 spri...
1. 问题有个功能需要调用一个传输文件的api,使用FileSystemResource进行传输,在调用api之前使用JSONObject.toJSONString()输出一下log之后 发现每次输出log之后本地文件就会变成0KB2. 分析FileSystemResource 是spring封装的类,其实现了WritableResource接口public class FileSystem...
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...
Itext7 API总结分辨率大部分情况下,生成的pdf是有打印需求的,打印就涉及到pdf分辨率的问题。在itext中除了插入的图片外其他都是矢量图所以不必担心分辨率的问题,只需要保证插入图片的分辨率即可,在itext中生成图片的分辨率默认是72dpi,这里是需要做一些处理的,如下:int defaultDpi = 72; int targetDpi = 300; Image test = ...
1. 原因与问题1.1 原因日常开发中有时候需要将某个对象集合的某个属性提取出来作为一个新的集合使用, 所以记录下来1.2 描述现在有一个叫 companyEmployeeList 集合 我们需要将里面的 employeeId 提取出来作为一个新的集合List<CompanyEmployee> companyEmployeeList = companyEmployeeMapper...
import com.fasterxml.jackson.annotation.JsonIgnore; /** * 密码 */ @JsonIgnore private String password;
1. 描述日常开发中我们通常会想将 List 集合根据某个成员变量为 key 值将其转成 Map 集合,如下:package com.wanlingyun.slhospital.patient.entity; @Data public class Conclucion { private String type; private String conclusionNo; ...
相同的: 都是浅拷贝,都提供了copyProperties()方法,只要属性名相同就可以从源bean中拷贝值到目标bean中不同点: BeanUtils.copyProperties提供类型转换功能,BeanUtils会调用默认的转换器(Converter)进行类型转换,所以在拷贝时能对八个基本类型间进行转换,不能转换时抛出错误PropertyUtils.copyProperties不提供类...
格式化日期查询String.format("%02d", day)如果day = 3那么输出的是03如果是day = 13那么输出的是13