Return-Path: Delivered-To: apmail-struts-dev-archive@www.apache.org Received: (qmail 84528 invoked from network); 8 Jul 2008 13:36:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Jul 2008 13:36:52 -0000 Received: (qmail 188 invoked by uid 500); 8 Jul 2008 13:36:51 -0000 Delivered-To: apmail-struts-dev-archive@struts.apache.org Received: (qmail 146 invoked by uid 500); 8 Jul 2008 13:36:51 -0000 Mailing-List: contact dev-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Developers List" Reply-To: "Struts Developers List" Delivered-To: mailing list dev@struts.apache.org Received: (qmail 135 invoked by uid 99); 8 Jul 2008 13:36:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jul 2008 06:36:51 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of belingueres@gmail.com designates 66.249.92.175 as permitted sender) Received: from [66.249.92.175] (HELO ug-out-1314.google.com) (66.249.92.175) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jul 2008 13:35:56 +0000 Received: by ug-out-1314.google.com with SMTP id h3so1206823ugf.23 for ; Tue, 08 Jul 2008 06:36:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=ADXSPHHrhDrIdlApateJe5JeqyL13hWxv5n+moiN+WE=; b=ljfXNJmEPWxKO+VJN4MTKLCA6cWxwWCWK5PzQ6xg7pHHt6IUQ4vrTqUFNSOv7kKBqp od8s0eWlePPlKIu/W2ceFbAaxVqFebZ6hR22qPUrcwYGzobkRzaZQIrS9A6Z5iVqHjZG PHk2hKf20elK0KDc4BAAWu7yfd/dcZ36wxxG4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=H47Cl4wbn3vzQ43kd805tNVnrSl9h70piXAe+PmAHIQNuXCELWSOOss6OC257jFLKy 0LyHQD4U19Da8Bajf0+o0LUKAcOcGW8FgpyhV9OCrgs7Kf1KkRPxrpD6SSVL6OKGuGYg IqZYBSLqkZFyOa1zpiKqF8kGbA3JACKvAXx+o= Received: by 10.210.29.11 with SMTP id c11mr4018034ebc.119.1215524177288; Tue, 08 Jul 2008 06:36:17 -0700 (PDT) Received: by 10.210.132.6 with HTTP; Tue, 8 Jul 2008 06:36:17 -0700 (PDT) Message-ID: Date: Tue, 8 Jul 2008 10:36:17 -0300 From: "Gabriel Belingueres" To: "Struts Developers List" Subject: Re: Enhancing "stream" type result In-Reply-To: <4872D910.7050106@blueskyminds.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <319605.85347.qm@web46116.mail.sp1.yahoo.com> <92544c510807071224h639d7872uc8980af60c6352f0@mail.gmail.com> <4872D910.7050106@blueskyminds.com.au> X-Virus-Checked: Checked by ClamAV on apache.org What about adding an outputStream ? For example, in one application I generate a PDF file using iText's PdfWriter class and it takes an outputStream. This output stream can then be copied to servlet output. 2008/7/8 Jeromy Evans : > -1 > > The params of StreamResult are already evaluated. Example: > > name="contentType">${contentType} > inputStream > attachment; filename="${fileName}" > ${contentLength} > 1024 > > > James Holmes wrote: >> >> Seems like a reasonable request to me. >> >> The best way to get these types of enhancements incorporated is to open up >> a >> JIRA ticket and attach a patch file. >> >> On Mon, Jul 7, 2008 at 3:18 PM, Struts Two wrote: >> >> >>> >>> I am using struts 2.0.11.1 and I just realized that you can not >>> dynamically set the filename using stream result (at least that is my >>> impression after a few hours of tweaking around the code). >>> I ended up extending StreamResult to set contentDisposition dynamically. >>> I >>> think it would be worthwhile if the code is modified to accomediate this >>> functionality[it would be only a few lines of code added]. Here is my >>> extension >>> public class DynamicStreamResult extends StreamResult { >>> @Override >>> protected void doExecute(String finalLocation, ActionInvocation >>> invocation) >>> throws Exception { >>> String filename = (String) invocation.getStack().findValue( >>> conditionalParse("name", invocation)); >>> contentDisposition = "filename=\"" + filename + "\""; >>> super.doExecute(finalLocation, invocation); >>> } >>> } >>> >>> >>> __________________________________________________________________ >>> Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your >>> favourite sites. Download it now at >>> http://ca.toolbar.yahoo.com. >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org >>> For additional commands, e-mail: dev-help@struts.apache.org >>> >>> >>> >> >> >> No virus found in this incoming message. >> Checked by AVG - http://www.avg.com Version: 8.0.138 / Virus Database: >> 270.4.5/1537 - Release Date: 6/07/2008 5:26 AM >> >> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org > For additional commands, e-mail: dev-help@struts.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org For additional commands, e-mail: dev-help@struts.apache.org