getOutputStream() has already been called for this response 异常处理

来源:互联网 发布:nginx tengine 编辑:程序博客网 时间:2024/05/22 13:27

在使用完输出流以后调用以下两行代码即可:
out.clear();
out = pageContext.pushBody();

 

如输出图片

 <%
   JbpmContext jbpmContext= JbpmConfiguration.getInstance().createJbpmContext();
    ProcessDefinition pd = jbpmContext.getGraphSession().findLatestProcessDefinition("abl");
    FileDefinition fd = pd.getFileDefinition();
    byte[] bytes = fd.getBytes("processimage.jpg");

 
 response.setContentType("image/jpeg");
 response.getOutputStream().write(bytes);
 out.clear();
 out = pageContext.pushBody();
 
   %>

原创粉丝点击