"Paul McKean Jr. d-3712 7-1213 pm39327 mckeapc" wrote:
>
> I'm attempting my first usage of JSP.  Previously, I've used JServeSSI to include 
>servlet output into a .jhtml page.
>
> I'm in the process of migrating to Tomcat and JServeSSI will not work in the servlet 
>2.2 environment.
>
> I'm attempting to do a <jsp:include page="/servlet/MyServlet" flush="true" /> to 
>include my servlet's output in my page.
>
> It seems to run the servlet; however, I'm getting the following error:
>
> Included servlet error: 500: Internal Servlet Error:
>
> java.lang.IllegalStateException: Writer is already being used for this request
> [...]

As the message suggest, your servlet is calling response.getOutpuStream() but the
JSP page has already called response.getWriter(); you can not use both a Writer
and a Stream on the same response. So, change your servlet to use response.getWriter()
instead and you'll be fine.

Hans
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to