You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Douglas Ferguson <do...@douglasferguson.us> on 2011/06/20 22:50:39 UTC

streaming files with wicket

I built a page with markup type = xml and set the content type and disposition so that the file will download.

This is great except when there is a fatal exception thrown, my error page is getting written to the downloaded file.

Any ideas how make the browser load the error page?

Only thought I had was to stream the file to disc and then send A) stream to browser if there is no exception or B) forward to error page.
But that kinda sucks as it is not truing streaming back to browser.

D/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: streaming files with wicket

Posted by Martin Grigorov <mg...@apache.org>.
Igor's response doesn't mention hitting disk.
You can do it in memory

On Mon, Jun 27, 2011 at 9:17 PM, Douglas Ferguson
<do...@douglasferguson.us> wrote:
> Yeah.. I thought of that, but I liked the idea of streaming without hitting
> disc.
>
> On Mon, Jun 20, 2011 at 3:55 PM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> i dont think there is a way once you start streaming with an
>> attachment header...
>>
>> you can try rendering the page into memory and writing that out
>> instead - so then you at least know your page rendered ok.
>>
>> -igor
>>
>> On Mon, Jun 20, 2011 at 1:50 PM, Douglas Ferguson
>> <do...@douglasferguson.us> wrote:
>> > I built a page with markup type = xml and set the content type and
>> disposition so that the file will download.
>> >
>> > This is great except when there is a fatal exception thrown, my error
>> page is getting written to the downloaded file.
>> >
>> > Any ideas how make the browser load the error page?
>> >
>> > Only thought I had was to stream the file to disc and then send A) stream
>> to browser if there is no exception or B) forward to error page.
>> > But that kinda sucks as it is not truing streaming back to browser.
>> >
>> > D/
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: streaming files with wicket

Posted by Douglas Ferguson <do...@douglasferguson.us>.
Yeah.. I thought of that, but I liked the idea of streaming without hitting
disc.

On Mon, Jun 20, 2011 at 3:55 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> i dont think there is a way once you start streaming with an
> attachment header...
>
> you can try rendering the page into memory and writing that out
> instead - so then you at least know your page rendered ok.
>
> -igor
>
> On Mon, Jun 20, 2011 at 1:50 PM, Douglas Ferguson
> <do...@douglasferguson.us> wrote:
> > I built a page with markup type = xml and set the content type and
> disposition so that the file will download.
> >
> > This is great except when there is a fatal exception thrown, my error
> page is getting written to the downloaded file.
> >
> > Any ideas how make the browser load the error page?
> >
> > Only thought I had was to stream the file to disc and then send A) stream
> to browser if there is no exception or B) forward to error page.
> > But that kinda sucks as it is not truing streaming back to browser.
> >
> > D/
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: streaming files with wicket

Posted by Igor Vaynberg <ig...@gmail.com>.
i dont think there is a way once you start streaming with an
attachment header...

you can try rendering the page into memory and writing that out
instead - so then you at least know your page rendered ok.

-igor

On Mon, Jun 20, 2011 at 1:50 PM, Douglas Ferguson
<do...@douglasferguson.us> wrote:
> I built a page with markup type = xml and set the content type and disposition so that the file will download.
>
> This is great except when there is a fatal exception thrown, my error page is getting written to the downloaded file.
>
> Any ideas how make the browser load the error page?
>
> Only thought I had was to stream the file to disc and then send A) stream to browser if there is no exception or B) forward to error page.
> But that kinda sucks as it is not truing streaming back to browser.
>
> D/
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org