当前位置:网站首页>When easyexcel uses converter conversion to inject nullpoint exception
When easyexcel uses converter conversion to inject nullpoint exception
2022-07-25 08:17:00 【A new dawn on the horizon】
Use EasyExcel The fields in the report are converted during import and Export
@Override
public CellData convertToExcelData(String code, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
if(StringUtils.isBlank(code)){
return new CellData("");
}else {
try {
RedisUtils redisUtils = SpringUtil.getBean(RedisUtils.class);
String s = redisUtils.get("WYM" + code);
log.info(" Company :" + s);
return new CellData(s);
}catch (Exception e){
log.error(" error ",e);
return new CellData(code);
}
}
}
Here I need to use RedisUtils, At first I used it directly @Autowired Annotation, but always report null pointer , The problem can be solved by changing the above method to inject
边栏推荐
- RTOS series (13): assembly LDR instruction, LDR pseudo instruction, [rn] register indirect reference detailed analysis
- Teach you to understand the computer optometry sheet
- The database of idea cannot prompt the table name, field name, and schema cannot be loaded
- 机器学习理论及案例分析(part1)--机器学习基础
- 【5G NR】UE注册拒绝原因
- Programmers can't play at the age of 35. Is it a fact or a misunderstanding?
- 【黑马程序员】Redis学习笔记002:持久化:RDB 和 AOF
- Implement hot post | community project with timed tasks and cache
- 孙子兵法随感
- 【黑马程序员】Redis学习笔记001:Redis简介+五种基本数据类型
猜你喜欢

CentOS 8.2 MySQL installation (xshell6)

Vs2019 C MFC installation

Hotel room management system based on jsp+servlet+mysql

滴滴 - dispatching

Network packet loss, network delay? This artifact helps you solve all problems

CM4 development cross compilation tool chain production

Chapter 3 business function development (modifying clues, data echo and modifying data)

Idea failed to start the project yamlexception Chinese file encoding format

Ensembles in RNA counts data in TCGA_ ID to gene_ Method of ID

A simple hotel background management system based on jsp+servlet+mysql
随机推荐
RTOS系列(13):汇编LDR指令、LDR伪指令、[Rn]寄存器间接引用 详细解析
Science: listening to music can really relieve pain. Chinese scientists reveal the neural mechanism behind it
Online bookstore system based on jsp+servlet+mysql
Chapter 3 business function development (realize the real-time response of the select all button)
Idea failed to start the project yamlexception Chinese file encoding format
第3章业务功能开发(修改线索,数据回显并修改数据)
Learn when playing No 3 | are enterprise learning resources wasted? Learn map one trick to solve!
How to create a simple electron desktop program
公寓报修系统(IDEA,SSM,MySQL)
刷题《剑指Offer》day01
Chapter 3 business function development (query clues)
Codeforces Round #809 Editorial(A,B,C)
Niuke dynamic planning training
【黑马程序员】Redis学习笔记003:Redis事务
JS cool rolling picture deformation animation JS special effects
Problems easily ignored by POM
Raspberry pie creation self start service
enq: HW – contention等待引起的故障分析
Mysql-5.7 installation
ip命令使用详解