Hi,

has anyone had this issue? We're getting emails from our users that
sometime when clicking on an ajax link the raw wicket ajax response is
being rendered on the browser - ie the just see all the html source
code on the page. Its not any particular page.

Anyone seen this or has any ideas?


The only thing we have changed recently was adding a non blocking file
download using a link and a shared resource which could be related due
to the Content Type.
In the configureResponse of the shared resource that we set the
Content Type for that request. Is there any chance that this is
somehow polluting the other threads requests?

public class DownloadFileResourceReference extends ResourceReference {
        public DownloadFileResourceReference() {
                super(DownloadLink.class, "");
        }

        private static final long serialVersionUID = 1L;

        public Resource newResource() {
                
                Resource r =  new Resource() {
                        private static final long serialVersionUID = 1L;

                        public IResourceStream getResourceStream() {
                                
                                        Long id = 
getParameters().getLong(DownloadLink.DOCID);
                                        // get file
                                        
                                        return new FileResourceStream(new 
File(file.getAbsolutePath()));
                        }

                        
                        protected void configureResponse(Response response) {
                        
                                Long id = 
getParameters().getLong(DownloadLink.DOCID);
                                
                                // get file
                                
                                ((WebResponse) 
response).setAttachmentHeader(df.getFileName());
                                
                                String mimeType = 
ResourceHelper.getContentType(df.getFileName());
                                if (!StringUtils.isEmpty(mimeType)) {
                                        ((WebResponse) 
response).setContentType(mimeType);
                                }
                                
                        }

                };
                r.setCacheable(false);
                return r;
        }

}

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to