Is there a restriction on the maximum size of post data on a web application server?

ぐ巨炮叔叔 提交于 2019-12-24 12:29:10

问题


In my web application there is a form which can contain a huge amount of data (this depends on the result of a previous query). When the form reaches a certain size, the servlet cannot cope and an exception is thrown. It seems that the first attempt to fetch a request parameter causes the problem.

I have tried to reproduce the problem on my test server but do not get a problem even when the data size is greater than on the production server.

As a result, I am now wondering if there is a server setting which restricts the size of data which can be passed in a request. I can only assume that there is a difference in the way the 2 servers are configured.

The application server is Websphere 7. I have tried the application using IE9, current FF and current Chrome - all produce the same result.

The exception is

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

The code

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 = "";
    ....

回答1:


POST data size may be limited by a setting in the HTTP channel configuration:

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

If there is a Web server in front of the WAS, then you should also check the PostSizeLimit property in the plug-in configuration:

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




回答2:


Seems there is a restriction - at least in Websphere App Server. Here is the response from IBM...

I reviewed your problem description. You are right, WAS 7 has number of maximum number of parameters allowed in inbound requests, but the number is very high, it is 10000 in both GET and POST requests. If you do not want to limit the number of parameters that can be included in a request you have to set "com.ibm.ws.webcontainer.maxParamPerRequest" webcontainer custom property to -1, for details see "Web container custom properties" - http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-nd-dist&topic=rweb_custom_props



来源:https://stackoverflow.com/questions/16584508/is-there-a-restriction-on-the-maximum-size-of-post-data-on-a-web-application-ser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!