If the the page returned by the JSP too large what will happen.
hay guys
here i am facing a bug problem.
I am requesting for a JSP page which will return an HTML page. that returned html file is too large(containig images). because of this i am getting an exception on server side saying...
java.net.ProtocolException: Didn't meet stated Content-Length, wrote: '4096' bytes instead of stated: '4421' bytes.
on client side also i am not getting total page.
how to resolve this problem.....
The server will tell the client how many bytes of data to expect, so it knows "what to expect".This is put in the HTTP heder as "Content-Length".
However, in your case, the actual length of the data doesn't match the stated length, hence the exception.
In your JSP code, do you make any changes to the HTTP header at all? Ideally, this would all be done by the JSP engine, so you shouldn't need to change any header values explicitly.
Are you using WebLogic 5.1?
WebLogic 5.1 before service pack 6, there is a bug with the ProtocolException Content-Length problem, upgrade to service pack 6 or later should solve the problem.
If you are writing your own stream outputing code, then the most likely problem would be the available() call to the stream. Misuse of this method will cause the content length exception too.
--lichu