Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java exception : Read of HTTP Request POST...

Status
Not open for further replies.

Gaelle

Programmer
Jun 20, 2001
62
0
0
FR
Hello !

I have an application in JSP, Java, HTML and so on running on Iplanet.
I get this error :
[26/Jun/2003:14:40:14] SEVERE ( 1749): StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.RuntimeException: Read of HTTP Request POST parameters failed: read < content length

I have tried to seek the web to find about this problem, but there is very little information about it, what I get is something like :
'the content sent was less than the content length'.
This really doesn't help me fix the bug !!!!

Please tell me what the problem is, or where it could come from if you have any idea !

Thanks,
Gaelle.
 
What is sending the POST request to the Server? A Browser?

The HTTP protocol includes a content-length: nnnnn\r\n header. The <nnnn> contains the length of the data posted. The client program is responsible for including this header and the value needs to match the size in bytes of the body of the request. The error indicates that the client sent body data that was not the same size (it was less) in bytes as it stated in the content-length header entry.

Here is an example of what an HTTP request excerpt might look like
Code:
content-length: 11\r\n
\r\n
Hello World


-pete
 
Thank you !

I think I begin to understand.
The POST request is sent by another jsp page, which contains a list of checkboxes, which correspond to the result of a search in a database.

To get the filled checkboxes, I use this code :

for (int i=0; i<=inblignes; i++) {
schecksupprimer = request.getParameter(&quot;checkajout&quot; + i);
sidarticle = request.getParameter(&quot;ligne&quot; + i);

if (schecksupprimer == null) {
bchecksupprimer = false;
} else {
bchecksupprimer = true;
srequete = &quot;insert into THMS values(&quot; + sidtem + &quot;, &quot; + sidarticle + &quot;)&quot;;
bresultatreq = call.lanceModif(srequete, sficproperties);
}
}

If I understand what you say in your reply (thanks again for try and help me !!!), I should set the content-length attribute ?
I'm going to look in that direction.

Nice to have help !
Gaelle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top