String out=null;
try {
ServletOutputStream os = servletResponse.getOutputStream();
Field ob= ReflectionUtils.findField(os.getClass(),"ob");
ob.setAccessible(true);
Object obValue= ReflectionUtils.getField(ob,os);
Field bb= ReflectionUtils.findField(obValue.getClass(),"bb");
bb.setAccessible(true);
Object bbValue= ReflectionUtils.getField(bb,obValue);
Field hb= ReflectionUtils.findField(bbValue.getClass(),"hb");
hb.setAccessible(true);
Object value= ReflectionUtils.getField(hb,bbValue);
out= null==value?null:new String((byte[])value, Charsets.UTF_8);
}catch (Exception e){
logger.debug("can not get response data",e);
out="ERROR:"+e.getMessage();
}
return out;