我遇到問題。在大GWT(2.4)-app我希望使用gwt-code-splitting。 GWT-compiller爲小型js零件裁剪了應用程序。GWT代碼拆分。 Splited文件不能在銀行加載
但是,whean欲加載一些模塊
final Module form = ModuleFactory.getInstance().getModule(modumesName);
/*/
private Module module = null;
public Module getModule(String moduleName){
if (moduleName.equals("M1")) {
GWT.runAsync(new RunAsyncCallback() {
@Override
public void onSuccess() {
module = GWT.create(M1.class);
}
@Override
public void onFailure(Throwable arg0) {
Window.alert("not load M1");
}
});
}
return module;
}
M1延伸模塊
當我打電話在第一次創建插件M1,我得到了一個js錯誤
「Uncaught com.goo gle.gwt.event.shared.UmbrellaException:捕獲到一個或多個異常,請參閱UmbrellaException中的全套#getCauses「
但是,在其他時間,我得到了我的模塊M1。在我看到的開發工具中,加載了分割部分。
public class CreateModuleWidget extends Composite{
private static final Binder binder = GWT.create(Binder.class);
interface Binder extends UiBinder<Widget, CreateModuleWidget> {}
public CreateModuleWidget() {
/*initparams**/
}
@UiHandler("createButt")
void onCreateClick(ClickEvent event) {
String modumesName = "M1";
final WidgetDialog dialog = new WidgetDialog(moduleName, true);
final Module form = ModuleFactory.getInstance().getModule(modumesName);
dialog.setDialogWidget(form);
dialog.show();
}
}
public class ModuleFactory{
private Module form = null;
private static ModuleFactory instance = null;
public static ModuleFactory getInstance(){
if(instance == null){
instance = new ModuleFactory();
}
return instance;
}
public Module getModule(String moduleName){
if (moduleName.equals("M1")) {
GWT.runAsync(new RunAsyncCallback() {
@Override
public void onSuccess() {
module = GWT.create(M1.class);
}
@Override
public void onFailure(Throwable arg0) {
Window.alert("not load M1");
}
});
}
return module;
}
}
未捕獲com.google.gwt.event.shared.UmbrellaException:一個或多個異常捕獲,見在UmbrellaException#getCauses BDC16B1A93B4190A8C1DD66EEF9838B8.cache.html全套:1435 (匿名函數)
請粘貼完整的堆棧跟蹤。 – 2013-02-17 10:41:05
謝謝!我在開發模式中添加完整的代碼 – user2080198 2013-02-17 11:16:54
(使用gwt瀏覽器插件)都工作正常。但是,當我編譯projet並在應用服務器上部署時,我的應用程序工作不正常 – user2080198 2013-02-17 11:27:18