Loading...

          java .net

          GWT.setUncaughtExceptionHandler

          GWT設置UncaughtExceptionHandler 以捕獲為捕捉的異常,這gwt在host mode編譯后的JavaScript如果出現(xiàn)錯誤,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("系統(tǒng)錯誤:"+text);
              }
          });

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

          公告

          希望有一天

          我能用鼠標雙擊我的錢包

          然后選中一張100元

          按住“ctrl+c”

          接著不停的“ctrl+v”

          嘻嘻~~~笑醒~~~



          導航

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

          統(tǒng)計

          常用鏈接

          留言簿(6)

          隨筆分類(102)

          隨筆檔案(398)

          文章分類

          文章檔案(10)

          有趣網(wǎng)絡

          搜索

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 绥化市| 呈贡县| 肥东县| 偃师市| 邢台县| 梁河县| 通化县| 科技| 时尚| 康马县| 咸丰县| 宁城县| 石景山区| 图木舒克市| 长阳| 镇平县| 绥化市| 大渡口区| 依兰县| 富民县| 沙田区| 平潭县| 辉县市| 同仁县| 山东| 东丰县| 长垣县| 桃源县| 会东县| 达日县| 华池县| 融水| 崇文区| 柏乡县| 彰化市| 沙坪坝区| 四川省| 铜鼓县| 曲沃县| 涞源县| 青海省|