[英]GWT 2.8 with Classic Dev Mode error when I use @JsType | @JsMethod sample
我的框架項目有一個EJB架構設計,客戶端GWT2.7 + gwt-material 1.6和smartGWT用於maven模型上的一些小部件,我也使用經典開發模式(對我來說最好)工具進行調試,我沒有遇到任何問題有了這個,直到今天......
當我將GWT2.7升級到2.8時我寫了一個@JsType示例,我得到了下一個錯誤:
com.google.gwt.core.client.JavaScriptException:(null)@ com.mypackage.MyApplication $ SomeClassJsType :: getName()([]):null
這是班級:
@JsType(isNative=true, namespace = "com.cnames")
public class SomeClassJsType {
@JsMethod
public static native String getName();
}
以下是我在EntryPoint中使用該類的方法
rootPanel.add( new Label( SomeClassJsType.getName() ) );
這是HTML頁面中的javascript片段
<body>
<script type="text/javascript">
com = { cnames: {} };
com.cnames.SomeClassJsType = function () {
this.name = "hello";
};
com.cnames.SomeClassJsType.getName = function () {
this.name = "world";
};
</script>
<script type="text/javascript" language="javascript" src="Application/Application.nocache.js"></script>
</body>
我的目標是,在Clasic Dev Mode上調試我的項目。
為什么? 如果我將GWT Material 1.6升級到2.0-rc2,我會收到下一個錯誤。
com.google.gwt.user.client.ui.AttachDetachException: Exception caught: 2 exceptions caught: Exception caught: (null) @gwt.material.design.client.js.JsMaterialElement::displayEffect()([]): null; Exception caught: (null) @gwt.material.design.client.js.JsMaterialElement::displayEffect()([]): null
我懷疑這是由@JsType注釋引起的
有什么建議么?
問候!
JsInterop只能與SuperDevMode一起使用,傳統devmode所需的所有字節碼重寫都沒有實現(對於僅適用於選擇和/或古老瀏覽器的棄用功能,浪費時間)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.