Jetty
  1. Jetty
  2. JETTY-118

response.sendRedirect in JSP produce exception (not critical)

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.0.0rc4
    • Fix Version/s: 6.1.0pre0
    • Component/s: JSP
    • Labels:
      None
    • Number of attachments :
      1

      Description

      java.lang.IllegalStateException: Closed
      at org.mortbay.jetty.HttpGenerator.prepareUncheckedAddContent(HttpGenerator.java:424)
      at org.mortbay.jetty.HttpGenerator$OutputWriter.writeUtf8(HttpGenerator.java:1385)
      at org.mortbay.jetty.HttpGenerator$OutputWriter.write(HttpGenerator.java:1333)
      at java.io.PrintWriter.write(PrintWriter.java:382)
      at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:148)
      at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:216)
      at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:134)
      at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:89)
      at org.apache.jsp.admin.data.group_view_post_jsp._jspService(org.apache.jsp.admin.data.group_view_post_jsp:89)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:440)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:335)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:443)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:356)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:179)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:226)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:615)
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
      at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:123)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
      at org.mortbay.jetty.Server.handle(Server.java:265)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:430)
      at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:692)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:617)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:193)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:339)
      at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:183)
      at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)

        Activity

        Hide
        Markus Kobler added a comment -

        It seems to be caused when a JSP page flushes its buffer after its set the redirect. The following patch simply mimics the same behaviour as addContent(content, last) in prepareUncheckedAddContent(). addContent(byte) should also be changed to drop content instead of throwing an exception.

        Show
        Markus Kobler added a comment - It seems to be caused when a JSP page flushes its buffer after its set the redirect. The following patch simply mimics the same behaviour as addContent(content, last) in prepareUncheckedAddContent(). addContent(byte) should also be changed to drop content instead of throwing an exception.
        Hide
        Greg Wilkins added a comment -

        Markus,

        I have added this to trunk for 6.1.

        But I am a little cautious about it.... I will investigate what the correct behaviour is after a close.

        Show
        Greg Wilkins added a comment - Markus, I have added this to trunk for 6.1. But I am a little cautious about it.... I will investigate what the correct behaviour is after a close.
        Hide
        Greg Wilkins added a comment -

        Oh.... and I forgot to say... thanks for the patch!

        Show
        Greg Wilkins added a comment - Oh.... and I forgot to say... thanks for the patch!

          People

          • Assignee:
            Greg Wilkins
            Reporter:
            Igor A Tarasov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: