Loading...

          java .net

          GWT.setUncaughtExceptionHandler

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

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

          公告

          希望有一天

          我能用鼠標(biāo)雙擊我的錢包

          然后選中一張100元

          按住“ctrl+c”

          接著不停的“ctrl+v”

          嘻嘻~~~笑醒~~~



          導(dǎo)航

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

          統(tǒng)計(jì)

          常用鏈接

          留言簿(6)

          隨筆分類(102)

          隨筆檔案(398)

          文章分類

          文章檔案(10)

          有趣網(wǎng)絡(luò)

          搜索

          積分與排名

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 马鞍山市| 大宁县| 竹溪县| 四子王旗| 忻城县| 朔州市| 同江市| 曲麻莱县| 平定县| 泰兴市| 汉川市| 卢湾区| 彰化县| 石河子市| 井研县| 莱州市| 湟源县| 博爱县| 绥德县| 新民市| 乡城县| 女性| 江津市| 临泽县| 鄂托克旗| 苍梧县| 西乡县| 开原市| 涡阳县| 祁阳县| 赤水市| 旬邑县| 建水县| 平昌县| 尉犁县| 兴业县| 望城县| 颍上县| 元江| 贞丰县| 涡阳县|