Bug复现 今天在写SpringBoot应用时,写一个后端生成图形验证码的业务时,需要用到session保存后端生成的图形验证码的Base64编码,然后前端通过session来显示图形验证码。 代码里用到了servlet里的HttpSession类,于是idea自动导入了javax.servlet包里的HttpSession。 业务代码如下: package cn.edu.wit.controller; import cn.edu.wit.entity.Result; import com.google.code.kaptcha.impl.DefaultKaptcha; import com.google.code.kaptcha.util.Config; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; //...