wood burning stoves*
The moose likes Servlets and the fly likes Max length of request parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Max length of request parameter" Watch "Max length of request parameter" New topic
Author

Max length of request parameter

Scott Duncan
Ranch Hand

Joined: Nov 01, 2002
Posts: 363
Anyone know if there is a maximum length of a string value being posted from a form? The thread seems to just freeze when I try to pull this value out of the request in my servlet. Is this container specific? I am using tomcat.


No more rhymes! I mean it!<br /> <br />Does anybody want a peanut?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

If the request is a POST, there's no max length other than good sense.

If a GET, there is a browser-dependent length that limits the length of the query string.

Bottom line, use POST when appropriate.
[ December 12, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
The thread seems to just freeze when I try to pull this value out of the request in my servlet.


You need to look elsewhere for the problem, getting a value from a request should be very quick. Kindly give us more information about the setup you are working with, how the request is generated, what you are doing with the data, etc.

Bill
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
As suggested, if it just hangs when
the form is submitted, check your form method.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Scott Duncan
Ranch Hand

Joined: Nov 01, 2002
Posts: 363
The form method is set to POST. The parameter value in question is set as a hidden input in the form. In the servlet:


Nothing special going on here as far as I know. The only thing that seems out of the ordinary is the value (as seen in the page source) is very long.
Scott Duncan
Ranch Hand

Joined: Nov 01, 2002
Posts: 363
Just to add more about the environment.

Using:

Tomcat 5.5
Java 5
Servlets/JSPs - no fancy frameworks
debugging with sysdeo eclipse plugin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Max length of request parameter
 
Similar Threads
how many bytes can XMLHttpRequest.responseText hold?
Converting string to int
Split using regex doubt
Parsing content body from a GET request
getContentLength() clarification