Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-4900

Setting a status code on an AbstractResource results in no HTTP body

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 6.2.0
    • 6.4.0, 1.5.10
    • None
    • None

    Description

      When implementing an AbstractResource, if ResourceResponse#setStatusCode is called, the HTTP body of the response comes back empty. I'm pretty sure this is due to the following check in AbstractResource#respond:

      if (!data.dataNeedsToBeWritten(attributes) || data.getErrorCode() != null || data.getStatusCode() != null)
      {
      return;
      }

      There are many HTTP status codes that are not errors that might warrant an HTTP body.

      Attachments

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            bheiskell Ben Heiskell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: