352262 发表于 2017-2-17 11:51:25

验证码在WebLogic下报错java.io.IOException: response already committed

  我的登录验证码代码,一个jsp,在Tomcat下没有问题,但放到weblogic下,每次请求都会报错:
  java.io.IOException: response already committed
  但使用没有问题。
  作如下修改即可不报错:
  加上response.reset();

// 图象生效
g.dispose();
//解决WebLogic下报错java.io.IOException: response already committed
response.reset();
  注释:

// 输出图象到页面
ImageIO.write(image, "JPEG", response.getOutputStream());
//解决java.lang.IllegalStateException: getOutputStream() has already been called for this response
//WebLogic下要注释掉下面两句
//out.clear();
//out = pageContext.pushBody();
页: [1]
查看完整版本: 验证码在WebLogic下报错java.io.IOException: response already committed