Wicket
  1. Wicket
  2. WICKET-3633

content type in header is being lost when using a AbstractTransformerBehavior

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4.17
    • Fix Version/s: 1.4.20, 1.5-RC4
    • Component/s: wicket
    • Labels:
      None

      Description

      The content type header information is being lost when using a AbstractTransformerBehavior, please see tha attached example of the problem for an example. It isnt causing a problem on my dev box but on live, it is, because the header info is not getting set tomcat/httpd (I'm assuming) is setting the header to plain/text so that the browser ends up showing the html rather than redering it. Here's a bit more information with wget, as you can see with the first call the content info is missing, with the second call without the AbstractTransformerBehavior being called (it's commented out in BasePage) the [text/html] header is included. I debug through wicket code and found that the issue was with the AbstractTransformerBehavior using a StringResponse whose setContentType() (Response.setContentType()) does nothing!!

      ============BUG============
      $ wget http://localhost:8080/wicket-bug/
      -2011-04-22 12:39:19- http://localhost:8080/wicket-bug/
      Resolving localhost (localhost)... ::1, 127.0.0.1
      Connecting to localhost (localhost)|::1|:8080... failed: Connection refused.
      Connecting to localhost (localhost)|127.0.0.1|:8080... connected.
      HTTP request sent, awaiting response... 200 OK
      Length: 483
      Saving to: `index.html'

      100%[==============================================================================>] 483 --.-K/s in 0s

      2011-04-22 12:39:20 (13.7 MB/s) - `index.html' saved [483/483]

      ============the transformer commented out============
      $ wget http://localhost:8080/wicket-bug/
      -2011-04-22 12:40:27- http://localhost:8080/wicket-bug/
      Resolving localhost (localhost)... ::1, 127.0.0.1
      Connecting to localhost (localhost)|::1|:8080... failed: Connection refused.
      Connecting to localhost (localhost)|127.0.0.1|:8080... connected.
      HTTP request sent, awaiting response... 200 OK
      Length: 479 [text/html]
      Saving to: `index.html.1'

      100%[==============================================================================>] 479 --.-K/s in 0s

      2011-04-22 12:40:28 (13.3 MB/s) - `index.html.1' saved [479/479]

      1. wicket-bug.zip
        12 kB
        Alinoor Rahman
      2. patch.patch
        1 kB
        Alinoor Rahman

        Activity

        Hide
        Alinoor Rahman added a comment -

        attached code example, un/comment line add(new BodyIdInsertTransformer()); in BasePage to see example of problem.

        Show
        Alinoor Rahman added a comment - attached code example, un/comment line add(new BodyIdInsertTransformer()); in BasePage to see example of problem.
        Hide
        Juergen Donnerstag added a comment -

        the problem only affects 1.4. 1.5 is using a BufferedWebResponse

        Show
        Juergen Donnerstag added a comment - the problem only affects 1.4. 1.5 is using a BufferedWebResponse
        Hide
        Alinoor Rahman added a comment -

        So this will be fixed in 1.4? and how soon? when is wicket 1.4.18 due?

        thanks!

        Show
        Alinoor Rahman added a comment - So this will be fixed in 1.4? and how soon? when is wicket 1.4.18 due? thanks!
        Hide
        Igor Vaynberg added a comment -

        this has been fixed in 1.5. if you really need this fixed for 1.4 please submit a patch.

        Show
        Igor Vaynberg added a comment - this has been fixed in 1.5. if you really need this fixed for 1.4 please submit a patch.
        Hide
        Alinoor Rahman added a comment -

        patch that fixes is problem in 1.4.x

        Show
        Alinoor Rahman added a comment - patch that fixes is problem in 1.4.x
        Hide
        Martin Grigorov added a comment -

        Reopen the ticket - there is a patch for 1.4.x

        Show
        Martin Grigorov added a comment - Reopen the ticket - there is a patch for 1.4.x
        Hide
        Martin Grigorov added a comment -

        The patch is applied with r1196040.

        Show
        Martin Grigorov added a comment - The patch is applied with r1196040.

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Alinoor Rahman
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development