sure it does :)

private class DownloadEulaPdfLink extends Link {

        public DownloadEulaPdfLink(String id) {
            super(id);
        }

        @Override
        public void onClick() {
            RequestCycle.get().setRequestTarget(new IRequestTarget() {

                public void detach(RequestCycle requestCycle) {
                }

                public Object getLock(RequestCycle requestCycle) {
                    return null;
                }

                public void respond(RequestCycle requestCycle) {
                    final String pdfPath="/WEB-INF/eula/"+props.getProperty(PROP_PDF);
                    InputStream pdfStream=getResourceAsStream(pdfPath);
                    if (pdfStream==null) {
                        throw new RuntimeException("Could not find PDF file, tried [["+pdfPath+"]]");
                    }

                    WebResponse r=(WebResponse) requestCycle.getResponse();
                    r.setAttachmentHeader("eula.pdf");
                    r.setContentType("application/pdf");
                    try {
                        Streams.copy(pdfStream, r.getOutputStream());
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
               
            });
        }
       
    }

On 7/17/06, Dorel Vaida < [EMAIL PROTECTED]> wrote:
Is there an easy way, (or an example :-)), of how to stream an Excel
(application/vnd.ms-excel) to the client ? With the beta4 version it was
working to write the bytes to wicket response's output stream and set
the content disposition etc on the http servet response, but that seem
not to work anymore.

Thanks,
Dorel


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to