我正在尝试通过以下方法获取 CookieProvider 的值:
public void getValue(){
StateManager.get().get("idReg", String.class, new Callback<String, Throwable>() {
public void onFailure(Throwable reason) {
state = "";
}
public void onSuccess(String result) {
state = result;
});
}
发出以下异常:
java.lang.NullPointerException at
com.google.web.bindery.autobean.gwt.client.impl.JsniCreatorMap$.create$(JsniCreatorMap.java:44)
at com.google.web.bindery.autobean.gwt.client.impl.AbstractAutoBeanFactory.
create(AbstractAutoBeanFactory.java:38) at
com.sencha.gxt.state.client.StateManager.getDefaultStateInstance(StateManager.java:90)
at com.sencha.gxt.state.client.StateManager$1.onSuccess(StateManager.java:73)
at com.sencha.gxt.state.client.StateManager$1.onSuccess(StateManager.java:1)
at com.sencha.gxt.state.client.CookieProvider.getValue(CookieProvider.java:54)
at com.sencha.gxt.state.client.StateManager.get(StateManager.java:64)
at com.rfrate.exrate.client.NorthComponent.setComboValue(NorthComponent.java:46)
at com.rfrate.exrate.client.NorthComponent.asWidget(NorthComponent.java:102)
at com.google.gwt.user.client.ui.Widget.asWidgetOrNull(Widget.java:46)
at com.sencha.gxt.widget.core.client.container.Container.add(Container.java:72)
at com.rfrate.exrate.client.ExRate.createNorth(ExRate.java:52)
at com.rfrate.exrate.client.ExRate.onModuleLoad(ExRate.java:97) ... 9 more
谁能给出一个在cookie中读取和写入变量字符串值的代码示例?