[ 
https://issues.apache.org/jira/browse/WICKET-4718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13437762#comment-13437762
 ] 

Martin Grigorov commented on WICKET-4718:
-----------------------------------------

Put a breakpoint in #getResourceStream() and see the stacktrace(s). Paste them 
here or in a pastebin too.

As a workaround you can null-ify your cached 'stream' by overriding 
org.apache.wicket.request.resource.IResource#respond():

@Override public void respond(Attributes attrs) {
   super.respond(attrs);

  cachedStream = null;
}
                
> ResourceStreamResource#getResourceStream() is called multiple times
> -------------------------------------------------------------------
>
>                 Key: WICKET-4718
>                 URL: https://issues.apache.org/jira/browse/WICKET-4718
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.0.0-beta3
>         Environment: Mac OS X 10.7.4 Lion, Java 6, IntelliJ Idea 11.1, Tomcat 
> 7 & Jetty 7.5.0
>            Reporter: Carsten Dräger
>
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to