请求头太大Spring-MVC-Ajax

时间:2016-11-15 14:30:39

标签: java ajax spring

当我在标题中发布xml数据时,它说Request标题太大了。我尝试了Stackoverflow上发布的所有解决方案。

Request header is too large

JAVA -tomcat- Request header is too large

我正在使用Spring-MVC-Ajax。

以下是Ajax Call

$("#btnSubmitEdit").click(
                        function(event) {
                            $(document.body).css({"pointer-events": "none", "cursor": "wait"});
                            var reqMsgId = $("#msgID").val();
                            var reqMsg = $("#xmlMessage").val();
                            $.ajax({
                                        url : "update/" + reqMsgId,
                                        data:{reqMsg: encodeURIComponent(reqMsg)},
                                        type : "POST",
                                        success : function(data) {
                                            $(document.body).css({"pointer-events": "", "cursor": "default"});
                                        },
                                        error : function(e) {
                                            $(document.body).css({"pointer-events": "", "cursor": "default"});
                                            alert("Error" + e.responseText);
                                        }
                                    });
                        });

这是弹簧控制器

@RequestMapping(value = "/update/{reqMsgId}", method = RequestMethod.POST)
public @ResponseBody String updatePage(@PathVariable("reqMsgId") String reqMsgId, @RequestParam("reqMsg") String reqMsg) {
    System.out.println(reqMsg);
    esbresubmitmessageservice.updateMessage(reqMsg, Integer.parseInt(reqMsgId));
    return "success";
}

获得以下错误:

INFO: Error parsing HTTP request header
 Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException: Request header is too large
    at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:512)
    at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:501)
    at org.apache.coyote.http11.InternalInputBuffer.parseRequestLine(InternalInputBuffer.java:171)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:996)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:640)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)

0 个答案:

没有答案