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.....

[480 byte] By [ponugoti_p] at [2007-9-26 1:38:43]
# 1

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.

artntek at 2007-6-29 2:26:58 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

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

lichudang at 2007-6-29 2:26:58 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
The images on an html page have nothing to do with the size of the data the JSP returns. Something goofy is happening within your application server or your application.
smiths at 2007-6-29 2:26:58 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...