|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Hi,
I hv the fwg code that reads a blob from an Oracle db and outputs it.. the prob is that the output is shown in the same browser window or in some cases opens abruptly in another application (in my case it opened in Homesite!!)... Is there any way I can force the output to appear in a new browser window like a pop up?? PHP Code:
Note, I am not setting the header as I dont want an save/open dialog box... Oh yes, one more thing.. sometimes on certain blobs, i get this error "java.lang.IllegalStateException: getOutputStream() has already been called for this response" Why does this happens?? any suggestions?? thnx, sgaucho |
|
#2
|
|||
|
|||
|
Well, as for setting the header, if you don't set a content type the browser is going to assume text/html. You probably don't want that if you're sending back an xls file.
As for a popup window, the best way would be to create the popup window *first*, and point it at your code. The odd window behavior is probably related to the content type not being text/html. As for the error, your while loop should look like Code:
OutputStream out = response.getOutputStream();
while(index < doc.length()) {
out.write(doc.getBytes(index,100));
index+=100;
}
|
|
#3
|
|||
|
|||
|
Hi,
I changed my code as per ur suggestion, but continue to get the "java.lang.IllegalStateException: getOutputStream() has already been called for this response" Error... AGain, this happens only on a few types of blobs.. whats strange is I hv 4 types of blobs.. word, an xls file, 1 text and 2 images... the code runs fine for all except for 1 image where it throws the above exception.. any more suggestions?? thnx again, sands |
|
#4
|
|||
|
|||
|
solved it.. closed the outputStream and the problem disappeared...
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > response.write |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|