• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

See this code why it gives exception

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic