getOutputStream() has already been called for this response

UI Components for JSF
Post Reply
daniel.grane
Posts: 30
Joined: 23 Oct 2009, 06:08

23 Oct 2009, 06:53

Hi all,

I've been trying to implement the dataexporter for my jsf datatable, but when I tried to set the type of the dataexporter to xls, I get the following error :

SEVERE: Servlet.service() for servlet Spring MVC Dispatcher Servlet threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:610)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:198)
at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:112)
at com.sun.facelets.FaceletViewHandler.createResponseWriter(FaceletViewHandler.java:414)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:571)
at org.springframework.faces.webflow.JsfView.render(JsfView.java:92)
at org.springframework.webflow.engine.ViewState.render(ViewState.java:257)
at org.springframework.webflow.engine.ViewState.resume(ViewState.java:216)
at org.springframework.webflow.engine.Flow.resume(Flow.java:551)
at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:263)



My Current .xhtml file is:

<p:dataTable id="tbl" styleClass="summary" var="o" value="#{obras}" paginator="true" rows="10">
<p:column resizeable="true" sortable="true">
<f:facet name="header">
<h:outputText value="Nombre" />
</f:facet>
<h:outputText value="#{o.name}" />
</p:column>
<p:column resizeable="true" sortable="true">
<f:facet name="header">
<h:outputText value="Precio" />
</f:facet>
<h:outputText value="#{o.price}">
<f:convertNumber type="currency" currencySymbol="$"/>
</h:outputText>
</p:column>
<p:column resizeable="true" sortable="true">
<f:facet name="header">
<h:outputText value="Saldo" />
</f:facet>
<h:outputText value="#{o.saldo}">
<f:convertNumber type="currency" currencySymbol="$"/>
</h:outputText>
</p:column>
<p:column resizeable="true" sortable="true">
<f:facet name="header">
<h:outputText value="Direccion" />
</f:facet>
<h:outputText value="#{o.address}" />
</p:column>
<p:column resizeable="true" sortable="true">
<f:facet name="header">
<h:outputText value="Direccion" />
</f:facet>
<h:outputText value="#{o.city}, #{o.state}, #{o.country}" />
</p:column>
<p:column resizeable="true">
<f:facet name="header">
<h:outputText value="Action" />
</f:facet>
<h:commandButton id="viewHotelLink" value="Ver Detalles" action="select" />
</p:column>
<p:column resizeable="true">
<f:facet name="header">
<h:outputText value="Action" />
</f:facet>
<h:commandButton id="verGastos" value="Ver Finanzas" action="gastosDetails"/>
</p:column>
<p:column resizeable="true">
<f:facet name="header">
<h:outputText value="Action" />
</f:facet>
<h:commandButton id="borrarObra" value="Borrar" action="borrarObra"/>
</p:column>

</p:dataTable>

<h:commandLink>
Exportar
<p:dataExporter type="xls" target="tbl" fileName="obras" />
</h:commandLink>


I have tried everything without success, so if you please can give me a hand, I'd really appreciate it.


Thanks.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

23 Oct 2009, 10:38

Exporter is used a lot with no problems and the java.lang.IllegalStateException: getOutputStream() has already been called for this response sounds like a spring webflow related issue. Are you having other weird issue when using primefaces with spring webflow. For example does the ajax work? Better spring webflow support is planned after PrimeFaces 1.0 is out.

User avatar
ydarcin
Posts: 258
Joined: 04 Jan 2009, 19:02
Location: Turkey

23 Oct 2009, 10:44

hi

can you check that you have the Apache poi 3.2-FINAL jar in your classpath?

Y.

daniel.grane
Posts: 30
Joined: 23 Oct 2009, 06:08

23 Oct 2009, 18:17

Cagatay:
Yeap, I thought the same, but the weird thing is that is working fine when I change the type to csv, and from what I've seen, the getOutputStream() is called just in the same way on both exporters.

Is there any beta version of primefaces 1.0 that I can try??

Yigit:

Yes I've poi 3.2 FINAL version (20081019)


Any other ideas??

Thanks both for your support.

Daniel.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 28 guests