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)

          有趣網絡

          搜索

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 盘锦市| 商河县| 阳泉市| 浙江省| 响水县| 中阳县| 麻阳| 郧西县| 水富县| 罗甸县| 襄垣县| 上高县| 荆州市| 广州市| 大埔区| 日土县| 浪卡子县| 张家口市| 永靖县| 德保县| 孝昌县| 库伦旗| 天祝| 仁怀市| 凤翔县| 盱眙县| 织金县| 湛江市| 交口县| 松滋市| 喀喇| 龙南县| 丰顺县| 延庆县| 灌南县| 中方县| 陆丰市| 琼结县| 息烽县| 尼玛县| 边坝县|