2 Replies Latest reply on Oct 25, 2005 2:38 PM by Erik Lindquist

    Sending Binary data using

    Erik Lindquist Newbie

      I'm using JBoss 4.0.2

      Here's my JSP source:

      <% java.io.OutputStream os = response.getOutputStream(); %>


      That's the entire thing. Here's what I get:

      java.lang.IllegalStateException: getOutputStream() has already been called for this response
      org.apache.catalina.connector.Response.getWriter(Response.java:596)
      org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:186)
      org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:124)
      org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:117)
      org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:191)
      org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:115)
      org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:75)
      org.apache.jsp.testout_jsp._jspService(org.apache.jsp.testout_jsp:52)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)


      It looks like org.apache.catalina.connector.Response.getWriter() is trying to make a call to response.getOutputStream when it shouldn't.

      Anyway, is there anyway to send binary data to a client using JBoss? (I'm using POI HSSF and iText for creating Excel and PDF docs.)

      Thanks, -Erik