【问题标题】:Is there a restriction on the maximum size of post data on a web application server?Web 应用程序服务器上发布数据的最大大小是否有限制?
【发布时间】:2013-05-11 04:09:59
【问题描述】:

在我的 Web 应用程序中,有一个表单可以包含大量数据(这取决于先前查询的结果)。当表单达到一定大小时,servlet 无法应对并引发异常。似乎第一次尝试获取请求参数会导致问题。

我尝试在我的测试服务器上重现该问题,但即使数据大小大于生产服务器上的数据,也没有遇到问题。

因此,我现在想知道是否存在限制可以在请求中传递的数据大小的服务器设置。我只能假设两台服务器的配置方式有所不同。

应用服务器是 Websphere 7。我已经尝试使用 IE9、当前 FF 和当前 Chrome 的应用程序 - 都产生相同的结果。

例外是

java.lang.IllegalArgumentException
com.ibm.wsspi.webcontainer.util.RequestUtils.parseQueryString 196
com.ibm.ws.webcontainer.servlet.RequestUtils.parsePostData 356
com.ibm.ws.webcontainer.srt.SRTServletRequest.parseParameters 2051
com.ibm.ws.webcontainer.srt.SRTServletRequest.getParameter 1651
com.acme.Servlet.getNDC 126
com.acme.Servlet.doPost 96
javax.servlet.http.HttpServlet.service 738
javax.servlet.http.HttpServlet.service 831
com.ibm.ws.webcontainer.servlet.ServletWrapper.service 1658
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest 940
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest 503
com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest 181
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest 91
com.ibm.ws.webcontainer.WebContainer.handleRequest 875
com.ibm.ws.webcontainer.WSWebContainer.handleRequest 1592
com.ibm.ws.webcontainer.channel.WCChannelLink.ready 186
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination 453
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest 515
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest 306
com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete 83
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted 165
com.ibm.io.async.AbstractAsyncFuture.invokeCallback 217
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions 161
com.ibm.io.async.AsyncFuture.completed 138
com.ibm.io.async.ResultHandler.complete 204
com.ibm.io.async.ResultHandler.runEventProcessingLoop 775
com.ibm.io.async.ResultHandler$2.run 905
com.ibm.ws.util.ThreadPool$Worker.run 1646

代码

protected String getNDC(HttpServletRequest request)
{
    String user = request.getHeader("iv-user");
    if (user == null)
        user = "";
    HttpSession session = request.getSession(false);
    String sessionString = session == null ? "" : session.getId();
    String action = request.getParameter(Constant.ACTION);   <=== ERROR HERE
    if(action == null)
        action = "";
    ....

【问题讨论】:

    标签: websphere application-server


    【解决方案1】:

    POST 数据大小可能受 HTTP 通道配置中的设置限制:

    http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.express.doc/info/exp/ae/urun_chain_typehttp.html

    如果WAS前面有Web服务器,那么还应该检查插件配置中的PostSizeLimit属性:

    http://www-01.ibm.com/support/docview.wss?uid=swg21460889

    【讨论】:

      【解决方案2】:

      似乎有一个限制 - 至少在 Websphere App Server 中。以下是 IBM 的回复...

      我查看了您的问题描述。你是对的,WAS 7 有数字 入站请求中允许的最大参数数量,但 数字非常高,在 GET 和 POST 请求中都是 10000。如果你 不想限制可以包含的参数数量 您必须设置“com.ibm.ws.webcontainer.maxParamPerRequest”的请求 webcontainer 自定义属性为 -1,详情参见“Web 容器 自定义属性” - http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-nd-dist&topic=rweb_custom_props

      【讨论】:

        猜你喜欢
        • 2010-10-06
        • 1970-01-01
        • 2015-11-03
        • 2020-10-22
        • 1970-01-01
        • 2018-05-04
        • 2021-03-12
        • 1970-01-01
        相关资源
        最近更新 更多