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

ByteArrayResource throws error if data is null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.5.3
    • 1.5.4, 6.0.0-beta1
    • wicket

    Description

      When ByteArrayResource#getData(org.apache.wicket.request.resource.IResource.Attributes) returns null, the class throws a WicketRuntimeException.

      This behavior differs from DynamicImageResource and ResourceStreamResource which instead issue the following call:
      response.setError(HttpServletResponse.SC_NOT_FOUND);

      ByteArrayResource should follow the same behavior. This would allow for instance to use it for resources which depend on the contents of attributes.getParameters(). When the parameters are invalid, a 404 should be issued instead of an exception.

      Attachments

        1. ByteArrayResource.patch
          2 kB
          Bertrand Guay-Paquet

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            berniegp Bertrand Guay-Paquet
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: