IllegalStateException...

Discussions

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

  1. IllegalStateException... (2 messages)

    HI,
    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(Response.java:218)
    at org.apache.tomcat.core.HttpServletResponseFacade.getWriter(HttpServletResponseFacade.java:150)
    at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:154)
    at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:146)
    at org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:191)
    at _0005cTestTag_0002ejspTestTag_jsp_27._jspService(_0005cTestTag_0002ejspTestTag_jsp_27.java:117)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:161)
    at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:247)
    at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:352)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java:626)
    at org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java:534)
    at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:378)
    at org.apache.tomcat.core.Context.handleRequest(Context.java:644)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:440)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:144)
    at org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java:310)
    at java.lang.Thread.run(Thread.java:484)

    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

    regards


    Charbel.
  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.

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

    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.

    charbel.