Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

can we close response.getOutputStream() ?

843842Sep 23 2008 — edited Oct 3 2008
I am using outputStream from servlet.
OutputStream outputStream = response.getOutputStream();
response.setContentType("application/octet-stream; charset=Windows-31J");
response.setHeader("Content-Disposition","attachment;filename=download.xml");
outputStream.write(w_constructedXML.getBytes());
outputStream.close();
We have to close any stream after done. But here, Does it make sense really to close output stream of response object ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 31 2008
Added on Sep 23 2008
4 comments
1,381 views