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

Improve ResourceStreamResource API by passing Attributes to #getResourceStream()

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.0.0-M1
    • Component/s: wicket
    • Labels:
      None

      Description

      I'd like to propose an improvement of org.apache.wicket.request.resource.ResourceStreamResource: it is currently quite hard to determine the IResourceStream inside the #getResourceStream method, as the relevant context (i.e. the Attributes object) isn't available. Of course it is possible to override #newResourceResponse to get access to Attributes, but the resulting code feels quite clumsy. I propose to pass the Attributes from #newResourceResponse into #internalGetResourceStream and finally into #getResourceStream.

      This of course breaks the current API, so I guess this would be something
      for Wicket 8.

      To put this in context, what we're doing is basically described in
      http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/ , except
      we don't extend DynamicImageResource, where you would have to handle mime
      type etc. in your subclass. By extending ResourceStreamResource, mime type
      etc. is handled by automatically.

      (Corresponding mailing list thread:
      http://apache-wicket.1842946.n4.nabble.com/Improve-ResourceStreamResource-api-td4673761.html )

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mgrigorov Martin Grigorov
                Reporter:
                jonas Jonas
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: