不能按要求生成器来发送POST参数

问题描述 投票:-1回答:1

它开辟了新的窗口,但使用GWT不通过邮政参数新窗口。

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);
    }
});
java rest gwt http-post
1个回答
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();
© www.soinside.com 2019 - 2024. All rights reserved.