struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gabriel Belingueres" <belingue...@gmail.com>
Subject Re: Enhancing "stream" type result
Date Sat, 12 Jul 2008 17:29:03 GMT
I may just do.

I just checked out the S2 and xwork code and I think it is not so
difficult to modify to support this requirement. I have now some free
time and it's a great opportunity to further learn about the S2
internals.

2008/7/9 Dave Newton <newton.dave@yahoo.com>:
> Feel free to submit a patch. Personally I'd probably just get the output of iText into
an input stream and use the existing stream result, though.
>
> Dave
>
> --- On Tue, 7/8/08, Gabriel Belingueres <belingueres@gmail.com> wrote:
>> What about adding an
>>
>> <param name="outputName">outputStream</param> ?
>>
>> 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
>> <jeromy.evans@blueskyminds.com.au>:
>> > -1
>> >
>> > The params of StreamResult are already evaluated.
>> Example:
>> >
>> > <result name="stream"
>> type="stream">  <param
>> >
>> name="contentType">${contentType}</param>
>> >  <param
>> name="inputName">inputStream</param>
>> >  <param
>> name="contentDisposition">attachment;
>> filename="${fileName}"</param>
>> >  <param
>> name="contentLength">${contentLength}</param>
>> >  <param
>> name="bufferSize">1024</param>
>> > </result>
>> >
>> > 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
>> <strutstwo@yahoo.ca> 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
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message