Hi people,
I don't understand this: I need return a archive in .xls format and if I set the property getOutPutStream in my HttpServletResponse, don't is possible obtain correct life cicle of my component.
I have the following:
- <a:region>
- <a:commandButton
- render="@form"
- execute="@region"
-
- value="Gerar RelatórioF"
- actionListener="#{acoesRealizadasMB.gerarRealatorio}"
- immediate="true" />
- </a:region>
- <h:commandButton type="button" value="Fechar"
- onclick="closeFrame();" immediate="true" />
-
- <rich:popupPanel id="mpStatusF" modal="true" moveable="true" resizeable="false" followByScroll="false" width="80" height="70">
- <div align="center">
- <div>
- <h:graphicImage value="/images/loading.gif" alt="Carregando" />
- </div>
- <div>
- <h:outputText value="#{message['aguarde']}" />
- </div>
- </div>
- </rich:popupPanel>
-
- <a:status id="teste" onstart="#{rich:component('mpStatusF')}.show()" onstop="#{rich:component('mpStatusF')}.hide()" />
and my MB are this form:
- private void enviarRelatorio(HSSFWorkbook wb) throws IOException {
- FacesContext context = FacesContext.getCurrentInstance();
- HttpServletResponse response = (HttpServletResponse) context.getExternalContext().getResponse();
- response.setDateHeader("Expires", 0);
- response.setHeader("Content-Disposition", "attachment; filename=acoesRealizadas.xls");
- response.setContentType("application/octet-stream");
- ServletOutputStream servletOutputStream = response.getOutputStream();
- wb.write(servletOutputStream);
- servletOutputStream.flush();
- servletOutputStream.close();
- context.responseComplete();
- }
anybody have this problem or have a possible solution?