Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.9
    • Fix Version/s: 2.9.1
    • Labels:
      None
    • Environment:

      OSX 10.8.2, Oracle Java JDK 1.7.0_09, Resin Pro 4.0.34

      Description

      I am an engineer for Caucho on the Resin Application Server, and was testing JSPWiki on Resin version 4.0.34. I would like to submit 2 fixes to enable JSPWiki to run better on Resin 4:

      #1. JSPWiki is calling getOutputStream after getWriter(). The servlet spec dictates we throw IllegalStateException for this situation. I see JSPWiki already has handling in UtilJ2eeCompat to use an OutputStream rather than a Writer depending on the container. The Resin check should have "useStream = true".

      #2. As a consequence of #1, JSPWiki serves empty content. This is due to buffering inside the PrintWriter used by WikiJSPFilter.ByteArrayResponseWrapper. The PrintWriter is never flushed when toString() is called on ByteArrayResponseWrapper. (This may not be a Resin specific issue.)

      I will attempt to attach a patch file to this bug report containing my fix to WikiJSPFilter.java.

      1. patch.txt
        5 kB
        Paul Cowan

        Issue Links

          Activity

          Hide
          Harry Metske added a comment -

          fixed in 2.9.1-svn-25

          Show
          Harry Metske added a comment - fixed in 2.9.1-svn-25
          Hide
          Jürgen Weber added a comment -

          both problems with WikiJSPFilter

          Show
          Jürgen Weber added a comment - both problems with WikiJSPFilter
          Hide
          Harry Metske added a comment -

          Any comments on this patch, or I'd like to take it in.

          regards,
          Harry

          Show
          Harry Metske added a comment - Any comments on this patch, or I'd like to take it in. regards, Harry
          Hide
          Paul Cowan added a comment - - edited

          There's also a writer vs outputStream issue when sending redirects. response.sendRedirect will call getOutputStream. I'm attaching a revised patch.

          Show
          Paul Cowan added a comment - - edited There's also a writer vs outputStream issue when sending redirects. response.sendRedirect will call getOutputStream. I'm attaching a revised patch.
          Hide
          Paul Cowan added a comment -

          Patch to WikiJSPFilter.java for Resin 4 compatibility, based on trunk revision 1440997 on 01/31/2013.

          Show
          Paul Cowan added a comment - Patch to WikiJSPFilter.java for Resin 4 compatibility, based on trunk revision 1440997 on 01/31/2013.

            People

            • Assignee:
              Harry Metske
              Reporter:
              Paul Cowan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development