wood burning stoves 2.0*
The moose likes Servlets and the fly likes how to avoid response.getOutputStream() exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to avoid response.getOutputStream() exception" Watch "how to avoid response.getOutputStream() exception" New topic

how to avoid response.getOutputStream() exception

kotha vijaybabu
Ranch Hand

Joined: Jan 28, 2006
Posts: 77

iam getting response.getOutputStream() has been already called exception
in my action class.
but i didnot called that in my project
that is coming from other code which is not accessible for me

so my question is how can i avoid that exception
it is creating much problem in my code while updating database

thanks in advance

Deepak Bala

Joined: Feb 24, 2006
Posts: 6661

Why do you need to get the output stream to update the database ? Can you post code here ?

SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Prabhu Venkatachalam
Ranch Hand

Joined: Nov 16, 2005
Posts: 502

response.getOutputStream() is used to reply raw bytes to client. How can It be realted with DB?

outputStream can be get only once for response. If you try to get second time you will get exception. You cannot avoid it.

Can you explain little bit about your problem?

Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />prabhu.venkatachalam@gmail.com
wood burning stoves
subject: how to avoid response.getOutputStream() exception
Similar Threads
IllegalStateException: getOutputStream() has already been called for this response
See this code why it gives exception
passing a Vector from JSP to an applet
Not able to open new browser instance for opening a xls in Secure Mode