• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: response.setContentStream fails servlet deployment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: response.setContentStream fails servlet deployment


  • Subject: Re: response.setContentStream fails servlet deployment
  • From: René Bock <email@hidden>
  • Date: Wed, 22 Aug 2012 17:04:23 +0200

So I will stick with stuffing data into memory...


Am 22.08.2012 um 16:41 schrieb Q:

This is a known bug in 5.4.3 when deploying as a servlet. My notes on this indicate that the offending code should be in _WOApplicationWrapper.servletDispatchRequest() if you feel like getting your hands dirty.

On 22/08/2012, at 11:30 PM, René Bock <email@hidden> wrote:

Hi every one,

In order not to store my download data in memory, I'm saving the data into a temp file.  To download the data I stream the data directly from file:

public void appendToResponse(WOResponse response, WOContext context) {
response.setHeader("application/octet-stream", "Content-Type");
response.setHeader("attachment; filename=" + fileName, "Content-Disposition");
   
   
try {
long dataLength = inputFile.length();
FileInputStream inputStream = new FileInputStream(inputFile);
response.setContentStream(inputStream, 0, dataLength);
} catch (IOException e) {
log.error("failed to get size: " + e.getMessage(), e);
}

}


This works as expected, but not when the app is deployed as a servlet container.

Has anybody a hint, why Content-Length=0  and only 0 bites are read  in servlet container deployment?




Regards,

René Bock
Software Engineering

--
salient doremus
http://www.salient.de http://www.openforms.de
Mit freundlichem Gruß,

René Bock
Software Engineering

--
salient GmbH 
Kontorhaus -  Lindleystraße 12, 60314 Frankfurt Main

Fon +49 (0)69 - 650096 -0, Durchwahl: - 18, Fax: -70

http://www.salient.de
http://www.doremus.com
http://www.openforms.de
http://www.mockabilly.com (http://itunes.apple.com/de/app/mockabilly/id392285046?mt=8)

Geschäftsführer: Peter Biler, Alexander Gerling, Lars Ohlerich
Amtsgericht Frankfurt am Main, salient GmbH HRB 48693

// salient wird mit heinze.de für den Deutschen Designpreis nominiert
// App für Deutsche Bank: db-X Trading & Investments
http://itunes.apple.com/de/app/db-x-trading-investments/id424215388?mt=8

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >response.setContentStream fails servlet deployment (From: René Bock <email@hidden>)
 >Re: response.setContentStream fails servlet deployment (From: Q <email@hidden>)

  • Prev by Date: Re: response.setContentStream fails servlet deployment
  • Next by Date: Re: WOLips 4.2
  • Previous by thread: Re: response.setContentStream fails servlet deployment
  • Next by thread: creating a second database connection
  • Index(es):
    • Date
    • Thread