Web tier: servlets, JSP, Web frameworks: IllegalStateException...

  1. IllegalStateException... (2 messages)

    I have created a Custom Tag in a JSP Page and when I try to use the <jsp:foward> inside the body tag I get this exception :
    java.lang.IllegalStateException: cannot find message associated with key : serverResponse.writer.ise
    at org.apache.tomcat.core.Response.getWriter(
    at org.apache.tomcat.core.HttpServletResponseFacade.getWriter(
    at org.apache.jasper.runtime.JspWriterImpl.initOut(
    at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(
    at org.apache.jasper.runtime.JspWriterImpl.flush(
    at _0005cTestTag_0002ejspTestTag_jsp_27._jspService(
    at org.apache.jasper.runtime.HttpJspBase.service(
    at javax.servlet.http.HttpServlet.service(
    at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(
    at org.apache.jasper.runtime.JspServlet.serviceJspFile(
    at org.apache.jasper.runtime.JspServlet.service(
    at javax.servlet.http.HttpServlet.service(
    at org.apache.tomcat.core.ServiceInvocationHandler.method(
    at org.apache.tomcat.core.ServletWrapper.handleInvocation(
    at org.apache.tomcat.core.ServletWrapper.handleRequest(
    at org.apache.tomcat.core.Context.handleRequest(
    at org.apache.tomcat.core.ContextManager.service(
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(

    Anyone has any clues as to why this happens? I understand it is something to do with the response being committed to the client. But how do I get round this problem and why does the foward works fine after the custom tage and before it however not inside its body.

    I appreciate your help


  2. try include instead of forward in your Requestdispatcher object. Hope it helps.

    Also check for if loop and break it whenever you want to end it and when you are trying to call morer than 1 jsp.

  3. I tired to use include but it had no effect :
    <mt:myTag name="test">
       <jsp:forward page="testpage.jsp"/>

    this what I am tryging to do and so in my custom tag I check for the attribute name and see if it is a equal to lets say test if it is then I evaluate the body else I dont.

    If i out include nothing happens. I tried to do the forward in my tag class so in the release method I did pageContext.forward but I go tthe same error the forward takes palce however the exception appeasr at bottom of page.

    thanks a lot.