for some time I am looking for clear answer, how to increase maximum size of data, that comes to servlet in the request? I have a servlet that receives xml data from another server. I have been told by admin of that another server, to increase the maximum allowed size to 6MB, shoot me but I have no clue where to set it. When some bigger data comes, their server is sending it all the time, because no successful status comes from mine.
By maximum size of data I mean max size of request's parameter(s) (String xml = request.getParameter("data");)
Author and all-around good cowpoke
Joined: Mar 22, 2000
The usual use of getParameter is for relatively short Strings from a HTML form submission.
If somebody was trying to POST megabytes of text to my servlet, I would avoid all the methods (such as get Parameter) which trigger the servlet container into trying to interpret the input as a form. Instead I would get the request body as a stream and try to process that.
With stream input you could process XML as either a Document or with a SAX or Stax parser.