• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

getOutputStream() has already been called for this response

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello..
I've googled this error and have seen a lot of solutions pertaining to response.getOutputStream() being called multiple times, but i dont really see this happening in my code or in the jsp.. I'm trying to download a file that is retrieved from the database as blob. The code below will show that after the blob is retrieved, it will write the file then allow the client to download this file. I've successfuly done this and the file gets downloaded, however in the tomcat console, this error appears. What could be wrong?
Would really appreciate your help.
Thanks in advance.

 
Kevin Valencia
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
by the way, the code above is placed in my action class..
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does your Action class return an ActionForward? That will attempt to write more data to the output stream.
 
Kevin Valencia
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Joe! Removing the actionforward solved it, wasnt aware it had something to do with the stream! Thanks a bunch...
 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Joe Ess:
Does your Action class return an ActionForward? That will attempt to write more data to the output stream.



Hello Joe Ess,
Thanks for replying.
 
Rahul Nair
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rahul Nair:


Hello Joe Ess,
Thanks for replying. removing ActionForward solved my issue.

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to know what you mean When you say remove ActionForward ?
Do you set ActionForward to null - I am still getting the exception if I set it to null.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephanie Johnson wrote:I would like to know what you mean When you say remove ActionForward ?
Do you set ActionForward to null - I am still getting the exception if I set it to null.


Change your method signature. Remove type ActionForward from return and use void

something like this. from:
public ActionForward methodName
to:
public void methodName
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic