它正在打开新窗口,但没有使用GWT将Post参数传递到新窗口。
final RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, encodedUrl);
rb.setHeader("Content-type", "application/x-www-form-urlencoded");
rb.setRequestData(json);
Request response = rb.sendRequest(json.toString(), new RequestCallback() {
public void onError(Request request, Throwable exception) {}
public void onResponseReceived(Request request, Response response) {
Window.open(rb.getUrl(), postTarget, postWinFeatures);
}
});
答案 0 :(得分:0)
FormPanel表单=新的FormPanel(目标);
form.setMethod(FormPanel.METHOD_POST);
form.setEncoding(FormPanel.ENCODING_URLENCODED);
Hidden params0 = new Hidden("dds", "xyz");
Hidden params1 = new Hidden("sdsdsd", "sdsd");
Hidden params2 = new Hidden("sdsd", "sdsdd");
FlowPanel panel = new FlowPanel();
panel.add(params0);
panel.add(params1);
panel.add(params2);
form.add(panel);
//form.add(buildPostURLParameter());
form.setAction(buildPostURL());
RootPanel.get().add(form);
form.submit();