• Post Reply Bookmark Topic Watch Topic
  • New Topic

getWriter() has already been called for this response

 
bernd pier
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey folks,
i have a servlet, which creates a DOMTree and write it into a xml file.
now i want to transform the DOMTree with transformerfactory.
compiling is no problem, but when i run the servlet i got following error:
getWriter() has already been called for this response.
i create a PrintWriter object in my servlet for one time, cause i had to write some html code.
in the DO;Serializer class, which is used from the servlet, i create a second PrintWriter object to write the xml file, but i use the close method for this object.
pls give me some help.
bernd
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Somewhere in your code you try to get an output stream from the response a 2nd time - thats the only way to get that error.
Bill
 
bernd pier
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx willliam,
your`re right sometimes it`s so easy.
bernd
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!