I have a MyArticlePresenter.java (in Client package). Its url is "mydomain.com#!article":
MyArticlePresenter.java has a RPC to call article. I want that after it get the articleData from database, it will clear everything in that GWT page & then reset the whole GWT page to new <html>
private AsyncCallback<GetArticleResult> getArticleCallback=new AsyncCallback<GetArticleResult>(){
@Override
public void onSuccess(GetArticleResult result) {
String articleData=result.getArticleData;
RootPanel.getBodyElement().setInnerHTML("<html>"+articleData+"</html>");
}
}
However, i got an error.
Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (String) @com.google.gwt.http.client.URL::encodeQueryStringImpl(Ljava/lang/String;)([string: 'chz']): invoke of @com.google.gwt.http.client.URL::encodeQueryStringImpl(Ljava/lang/String;) failed
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:576)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:284)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.http.client.URL.encodeQueryStringImpl(URL.java)
at com.google.gwt.http.client.URL.encodeQueryString(URL.java:325)
at com.gwtplatform.mvp.client.proxy.ParameterTokenFormatter.escape(ParameterTokenFormatter.java:198)
at com.gwtplatform.mvp.client.proxy.ParameterTokenFormatter.toPlaceToken(ParameterTokenFormatter.java:190)
at com.gwtplatform.mvp.client.proxy.ParameterTokenFormatter.toHistoryToken(ParameterTokenFormatter.java:122)
at com.gwtplatform.mvp.client.proxy.PlaceManagerImpl.updateHistory(PlaceManagerImpl.java:492)
at com.gwtplatform.mvp.client.proxy.ProxyPlaceAbstract$3$1.execute(ProxyPlaceAbstract.java:208)
at com.google.gwt.core.client.impl.SchedulerImpl$Task$.executeScheduled$(SchedulerImpl.java:50)
at com.google.gwt.core.client.impl.SchedulerImpl.runScheduledTasks(SchedulerImpl.java:180)
at com.google.gwt.core.client.impl.SchedulerImpl.flushPostEventPumpCommands(SchedulerImpl.java:345)
at com.google.gwt.core.client.impl.SchedulerImpl$Flusher.execute(SchedulerImpl.java:78)
at com.google.gwt.core.client.impl.SchedulerImpl.execute(SchedulerImpl.java:138)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:576)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:284)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:347)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
at java.lang.Thread.run(Unknown Source)
Can you find a method that reset the whole GWT page elegantly?