File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes See this code why it gives exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "See this code why it gives exception" Watch "See this code why it gives exception" New topic
Author

See this code why it gives exception

Markandey Sahu
Greenhorn

Joined: Jun 29, 2006
Posts: 13
Hi all
i have one problem pls reply me with reason.
thanks in advance


It gives
java.lang.IllegalStateException: getOutputStream() has already been called for this response
My question is when it's already been called?
And one another question Can we print String in this object

or this object is only for binary output. pls give me reason for both the case
1.servlet class
2.jsp page
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

My question is when it's already been called?

You're in a JSP file. The output stream will be open at the beginning, to output your html tags.

this object is only for binary output. pls give me reason for both the case

It's ok, you can use a String, in a servlet. Just don't use that method in a JSP file, as you've seen in your first question.


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: See this code why it gives exception