当运行使用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