Loading...

          java .net

          GWT.setUncaughtExceptionHandler

          GWT設置UncaughtExceptionHandler 以捕獲為捕捉的異常,這gwt在host mode編譯后的JavaScript如果出現錯誤,No errors in Hosted Mode and Compiled localy, but deployed to tomcat yields in errors
          這是惱人,加上UncaughtExceptionHandler起碼有一絲線索
          GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
              public void onUncaughtException(Throwable throwable{
                  String text = "Uncaught exception: ";
                  while (throwable != null{
                      StackTraceElement[] stackTraceElements = throwable
                              .getStackTrace();
                      text += throwable.toString() + "\n";
                      for (int i = 0i < stackTraceElements.lengthi++) {
                          text += "    at " + stackTraceElements[i] + "\n";
                      }
                      throwable = throwable.getCause();
                      if (throwable != null{
                          text += "Caused by: ";
                      }
                  }
                  System.err.print(text);
                  text = text.replaceAll(" ", " ");
                  Window.alert("系統錯誤:"+text);
              }
          });

          posted on 2010-05-19 10:18 閱讀(381) 評論(0)  編輯  收藏 所屬分類: gwt

          公告

          希望有一天

          我能用鼠標雙擊我的錢包

          然后選中一張100元

          按住“ctrl+c”

          接著不停的“ctrl+v”

          嘻嘻~~~笑醒~~~



          導航

          <2010年5月>
          2526272829301
          2345678
          9101112131415
          16171819202122
          23242526272829
          303112345

          統計

          常用鏈接

          留言簿(6)

          隨筆分類(102)

          隨筆檔案(398)

          文章分類

          文章檔案(10)

          有趣網絡

          搜索

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 故城县| 高阳县| 陈巴尔虎旗| 于都县| 紫金县| 建阳市| 精河县| 凤凰县| 航空| 贵溪市| 奎屯市| 两当县| 金山区| 宣恩县| 盐边县| 广宗县| 武乡县| 呼和浩特市| 张家港市| 罗田县| 沂南县| 依兰县| 呼伦贝尔市| 静安区| 西乌珠穆沁旗| 南康市| 英超| 平南县| 晋中市| 张家界市| 凌海市| 河西区| 北海市| 武宁县| 长寿区| 凉城县| 清流县| 德兴市| 宁陵县| 桓仁| 虎林市|