Jetty
  1. Jetty
  2. JETTY-375

Perfoming an action against the response that would cause an IllegalStateException if the response has been comitted

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.1.4
    • Fix Version/s: None
    • Component/s: Servlet
    • Labels:
      None
    • Environment:
      Windows XP
    • Number of attachments :
      0

      Description

      I'm trying to run tck/servlet test with jetty6.1.4. Some cases failed.

      Below is the test strategy for one of the failed cases:
      @test_Strategy: Validate PageContext.include() with flush argument provided

      • and set to true. Response should be commited after the
      • flush. Test validates this by perfoming an action against
      • the response that would cause an IllegalStateException if
      • the response has been comitted. This also validated
      • the inclusion of a resource identified by a page-relative path

      To simplify it, I had write a simple jsp file to reproduce this issue.

      <%@ page import="java.io.PrintWriter"%>
      <%@ page contentType="text/plain"%>

      <%
      boolean passed = false;
      PrintWriter pw = response.getWriter();
      pw.println("THIS TEXT SHOULD APPEAR");
      response.flushBuffer();
      try

      { response.sendError(1,"HttpServletResponse.SC_GONE"); passed = false; pw.println("IllegalStateException exception should have been thrown"); }

      catch (Throwable t) {
      if (t instanceof IllegalStateException)

      { passed = true; }

      else

      { passed = false; pw.println("Exception thrown, but was not an instance of IllegalStateException."); pw.println("instead received: " + t.getClass().getName()); }

      }
      pw.println("Is test passed? "+passed);
      %>

      I had tested this jsp file with jetty6.1.3 and jetty6.1.4.

      6.1.3 can work fine but 6.1.4 failed.

        Activity

        Hide
        Greg Wilkins added a comment -

        This is now fixed in svn and the pushed snapshot.

        Note that I am not sure under the terms of the TCK license you are allowed
        to post information in public. So if you do have any other failures, perhaps
        raise the issue but send the details in private email. I have permission
        to use the TCK, but only in the context of geronimo.

        Show
        Greg Wilkins added a comment - This is now fixed in svn and the pushed snapshot. Note that I am not sure under the terms of the TCK license you are allowed to post information in public. So if you do have any other failures, perhaps raise the issue but send the details in private email. I have permission to use the TCK, but only in the context of geronimo.
        Greg Wilkins made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Xiao-fei Wang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: