Win a copy of Penetration Testing Basics this week in the Security forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception problem about OutputStream already obtained

max seto
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
i'm writing a code to retrieve BLOB data from Oracle in servlet and convert it to byte[]. then forward the byte[] value to JSP for display. i'm using IBM websphere for development. The code below is what i used to display the BLOB data in JSP.
byte[] blobArr = (byte[])request.getAttribute("blobArr");
String fileType = (String)request.getAttribute("fileType");
if(fileType.equals("text/plain")) {
ByteArrayInputStream bin = new ByteArrayInputStream(blobArr);
int c;
while((c = != -1) {
else {
the problem is that although it displays the data(doc, xls...) well, it throws an exception error out :
java.lang.IllegalStateException: OutputStream already obtained
i know that it occurs when calling the method getOutputStream( ). however, why does it occur? and how to prevent it? pls someone tell me. thanks a lot!!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic