• Post Reply Bookmark Topic Watch Topic
  • New Topic

See this code why it gives exception  RSS feed

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!