[TEEDA-375] ダウンロードを IE でキャンセルした際の対応について Created: 2007-09-14 Updated: 2007-09-19 Resolved: 2007-09-19 |
|
Status: | Resolved |
Project: | Teeda |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | 1.0.11 |
Type: | Task | Priority: | Major |
Reporter: | shot | Assignee: | shot |
Resolution: | Fixed | Votes: | 0 |
Labels: | None |
Description |
下記はTeeda側でキャンセル時にチェックドな例外を投げたり、 Seasar-user:10949 CSVファイルのダウンロードで「開く、保存、キャンセル」画面でキャンセルしたとこ CSVファイルのダウンロードは、Actionクラスで //内容を書き出して out.close(); 別の目的でIntercepterを作成しています。この中で、 catch (ClientAbortException e) { // 無視 }よろしくお願いします。 エラーのログです。 |
Comments |
Comment by shot [ 2007-09-19 ] |
ユーザキャンセル時に対してUtilを準備しました. <component class="org.seasar.teeda.core.util.DefaultCancelHandler"> <initMethod name="addCancellableException"> <arg>@java.net.SocketException@class</arg> </initMethod> </component> キャンセルかどうかの判定にはorg.seasar.teeda.core.util.CancelUtilを OutputStream os = null; try { os = response.getOutputStream(); os.write(FileUtil.getBytes(file)); } catch (IOException e) { Throwable cause = e.getCause(); if (!CancelUtil.isCancelled(cause)) { throw new AppFacesException("E0000002"); } else { System.out.println("user cancelled...."); } } finally { try { os.close(); } catch (final IOException e) { } } this.facesContext.responseComplete(); |