Return-Path: Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: (qmail 40777 invoked from network); 18 May 2007 14:10:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 May 2007 14:10:40 -0000 Received: (qmail 62946 invoked by uid 500); 18 May 2007 14:10:45 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 62537 invoked by uid 500); 18 May 2007 14:10:44 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 62526 invoked by uid 99); 18 May 2007 14:10:44 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2007 07:10:44 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2007 07:10:37 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3025E71406F for ; Fri, 18 May 2007 07:10:17 -0700 (PDT) Message-ID: <4616338.1179497417190.JavaMail.jira@brutus> Date: Fri, 18 May 2007 07:10:17 -0700 (PDT) From: "Cagatay Civici (JIRA)" To: dev@myfaces.apache.org Subject: [jira] Resolved: (TOMAHAWK-979) ExcelExport - correct name for the downloaded file In-Reply-To: <25943515.1178575275542.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/TOMAHAWK-979?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Cagatay Civici resolved TOMAHAWK-979. ------------------------------------- Resolution: Fixed Fix Version/s: (was: 1.1.5) 1.1.6-SNAPSHOT Although I always get the open/save dialog without the Content-disposition, it's good to ensure it. The fix is checked in. > ExcelExport - correct name for the downloaded file > -------------------------------------------------- > > Key: TOMAHAWK-979 > URL: https://issues.apache.org/jira/browse/TOMAHAWK-979 > Project: MyFaces Tomahawk > Issue Type: Bug > Affects Versions: 1.1.5 > Environment: Suse Linux 10.0 - with Firefox 1.5.0.10 > Reporter: Emil Cazacu > Assigned To: Cagatay Civici > Priority: Minor > Fix For: 1.1.6-SNAPSHOT > > > I started from the example presented in the public site. > I click on the button, a new page is poped, then that page is blank. > Without knowing what happened, the file is saved in the background where it usualy saves the downloaded files. > I come with a correction for the class ExcelExportPhaseListener > private void writeExcelOutput( > HSSFWorkbook workBook, > HttpServletResponse response, > HtmlDataTable dataTable) throws IOException { > response.setContentType("application/vnd.ms-excel"); > response.setHeader("Expires", "0"); > response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0"); > response.setHeader("Pragma", "public"); > response.setHeader("Content-disposition", "attachment;filename=" + dataTable.getId() + ".xls"); > workBook.write(response.getOutputStream()); > } > Changes in behavior: > - the downloaded file is named using the id of the component prefixed with .xls > - a popup is presented to allow us between the options "run / save as" > Changes in code: > - the headers, very important being the "Content-disposition" > - the number of the arguments is changed. > I have previous experience with downloading excel file but using servlets. > I am using JSF but writing JSF exceeds my knowledge. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.