Captcha captcha = getCaptcha(captchaId);
   
// 通过反射获取验证码值
Class<?> classType = captcha.getClass();
Field field;
field = classType.getDeclaredField("response");
field.setAccessible(true); // 抑制Java对修饰符的检查
logger.debug("反射得到的验证码:{}", field.get(captcha));

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-26
  • 2021-09-26
  • 2021-11-27
  • 2022-12-23
  • 2022-02-11
  • 2022-12-23
猜你喜欢
  • 2021-09-25
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2021-06-08
相关资源
相似解决方案