當運行使用Errai的UI我的GWT應用Errai - JSONException:錯誤>解析JSON:語法錯誤:意外標記<
我得到這個錯誤:
WARNING: Replacing Element type [INPUT] with type [BUTTON] Compositing @Replace [data-field=username] element [] with Component com.google.gwt.user.client.ui.TextBox [] Compositing @Replace [data-field=password] element [] with Component com.google.gwt.user.client.ui.TextBox [] com.google.gwt.json.client.JSONException: Error parsing JSON: SyntaxError: Unexpected token <
的@PostConstruct
期間我已經添加RootPanel.get().clear()
但仍然出現錯誤。
@PostConstruct
public void setup()
{
// Fix for Unexpected token JSONException being thrown
RootPanel.get().clear();
login.setText("Login");
login.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Window.alert("Logging in");
}
});
RootPanel.get("rootPanel").add(this);
}
我可能會錯過什麼?
你能顯示你的模板的html嗎? – 2013-02-27 20:04:13
沒問題,在這裏:http://pastebin.com/VK2jgyPw – xybrek 2013-02-27 23:48:45
你如何聲明你的主頁小部件?很高興看到註釋以及數據字段在Home窗口小部件中的聲明方式。 – 2013-02-28 06:17:01