Hello,

Iam using AJAXDownload to download some data which will created on the fly, 
while clicking an AjaxButton. Moreover Iam using an AbstractResourceStream. In 
its getInputStream method, I get an byte array. This method can throw some 
exception, which I will catch. If an exception is thrown, I want to redirect to 
an errorpage. It is shown in the code below. Nothing happens when the exception 
is thrown. Can somebody help me please?

download = new AJAXDownload() {
                @Override
                protected IResourceStream getResourceStream() {
                    return new AbstractResourceStream() {
                        InputStream data;
                        @Override
                        public InputStream getInputStream(){
                            try {
                                data = new 
ByteArrayInputStream(ConsoleDataHandlerImpl.getInstance().getReportAsByteStream(slaReportModel.getTxtDatumVon(),slaReportModel.getTxtDatumBis()));
                            } catch (Exception e) {
                                log.error(ExceptionUtils.getStackTrace(e));
                                setResponsePage(new 
InternalError(e.getMessage()));
                            }
                            return data;
                        }

                        @Override
                        public void close() throws IOException {
                            data.close();
                        }
                    };
                }

                @Override
                protected String getFileName(){
                    return filename;
                }
 };
            this.add(download);
            download.initiate(target);


Mit freundlichen Grüßen
Christoph Manig
Systems Engineer

T-Systems International GmbH
Systems Integration - SC Travel, Transport & Logistics
Hoyerswerdaer Str. 18
01099 Dresden
tel.:   +49 (0) 351 / 8152 - 188
fax:    +49 (0) 351 / 8152 - 209
email:  christoph.ma...@t-systems.com

T-SYSTEMS INTERNATIONAL GMBH
Aufsichtsrat: Thomas Dannenfeldt (Vorsitzender)
Geschäftsführung: Reinhard Clemens (Vorsitzender), Dr. Ferri Abolhassan, Thilo 
Kusch, Dr. Markus Müller, Georg Pepping, Hagen Rickmann
Handelsregister: Amtsgericht Frankfurt am Main HRB 55933
Sitz der Gesellschaft: Frankfurt am Main
WEEE-Reg.-Nr. DE50335567



Reply via email to