File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 6662

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 />
I agree. Here's the link:
subject: how to avoid response.getOutputStream() exception
jQuery in Action, 3rd edition