Please browse the categories below to previous answers to questions like yours. If you do not find the answer for your particular situation, ask for help on the appropriate mailing list.
(Answer) (Category) Java Apache Project : (Category) Apache JServSSI : (Category) Calling getWriter causes an IllegalStateException :
Use getOutputStream instead
The SSI internals call getOutputStream() so you are not allowed to call getWriter() (only one of the two get functions may be called).
A workaround is to do the following:
 public void doGet(HttpServletRequest req, HttpServletResponse res)
      throws ServletException, IOException
 {
  PrintWriter out = new PrintWriter(res.getOutputStream());
  [...]
  // don't close the PrintWriter or you will lose the rest of your page.
  out.flush();
 }

ericATactualsoftwareDOTcom
[Append to This Answer]
Next: (Answer) More Info on Jason Hunters Java Servlet Programming
This document is: http://java.apache.org/faq/?file=90
[Search] [Appearance] [Show Expert Edit Commands]
This is a Faq-O-Matic 2.709.
Please browse the categories below to previous answers to questions like yours. If you do not find the answer for your particular situation, ask for help on the appropriate mailing list.