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

ResourceStreamResource#getResourceStream() is called multiple times

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 6.0.0-beta3
    • 1.5.8, 6.0.0
    • wicket
    • None
    • Mac OS X 10.7.4 Lion, Java 6, IntelliJ Idea 11.1, Tomcat 7 & Jetty 7.5.0

    Description

      When a ResourceStreamResource is implemented to return a IResourceStream dynamically, by returning a new instance of an extended AbstractResourceStream, that ResourceStream is instantiated multiple times when a ResourceLink is clicked.

      In my case, that ResourceStream returns an AttachmentInputStream from the Ektorp library (for CouchDB interaction). This behavior results in multiple queries (currently up to four) when I click once on a ResourceLink to that resource.

      Code Examples
      Extended ResourceStreamResource: http://pastebin.com/9BB7LEiV
      Extended IResouceStream: http://pastebin.com/Z7GvzGja

      Attachments

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            blacklight Carsten Dräger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: