Hi there, I have a servlet which sends a lot of text to the response PrintWriter based on a db lookup. At the end of each paged served by this servlet I want to output an info about the size of the page the web visitor just has retrieved, e.g.: "This page is 36.340 bytes in size." Any idea how to do this? There seems to be no getContentSize method available in HttpServletResponse.
-----------------------------<br /><a href="http://www.rottmann.net" target="_blank" rel="nofollow">http://www.rottmann.net</a><p>"The real voyage of discovery consists not in making new landscapes but in having new eyes." <br />Marcel Proust (1871-1922)
Author and all-around good cowpoke
Joined: Mar 22, 2000
You could create a StringWriter as a local buffer and write everything to it , get the size, then output the resulting String. Bill