Forums Register Login

The concept of buffering in servlets

+Pie Number of slices to send: Send
hi,

The response.reset() of HttpServletResponse should throw IllegalStateException if it is called after the response has been commited. In my code i have used isCommited()to find out if the response is commited and it gives true. After the response is commited i call the reset()which sholud give an exception as expected.But i am not getting any exception......i get the response without any exceptions which should not be the case.Why am i not getting any exception. Can anyone give a small sample code illustrating the usage of reset().


here's my code


[ November 10, 2005: Message edited by: Mark Spritzler ]
+Pie Number of slices to send: Send
I'm sorry but why on earth do you care? It is bad enough overriding the service() method - that is not considered good practice - but why do you need the reset() to throw an exception? Perhaps it is a bug - you don't tell us what container you're using. But I can't figure out why you want the exception. Is there a good reason or is this a fishing expedition?
+Pie Number of slices to send: Send
Well right now your flushBuffer() call is remarked off.

I am going to move this to the Servlets forum.

Mark
+Pie Number of slices to send: Send
 

Originally posted by Scott Dunbar:
I'm sorry but why on earth do you care? It is bad enough overriding the service() method - that is not considered good practice - but why do you need the reset() to throw an exception? Perhaps it is a bug - you don't tell us what container you're using. But I can't figure out why you want the exception. Is there a good reason or is this a fishing expedition?






hi

The container i am using is tomcat5.0.25.
You are right.......there is no good reason but just experimenting with this small bit of code to understand the internal logic used in the buffering concept of servlets.....

I think it does not matter which method is being overriden here(be it service()/doGet()/doPost()......).

So as per the concept it should throw an exception......which i am not getting on executing the above code.

Any ideas please???


Thank You
+Pie Number of slices to send: Send
That is indeed an interesting question. In the source code for the Tomcat 5.0.27 ResponseFacade.java we find


So it is not clear why you are not seeing the exception.
Bill
+Pie Number of slices to send: Send
 

Originally posted by William Brogden:
That is indeed an interesting question. In the source code for the Tomcat 5.0.27 ResponseFacade.java we find


So it is not clear why you are not seeing the exception.
Bill













nothing is working out
Ew. You guys are ugly with a capital UG. Here, maybe this tiny ad can help:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 476 times.
Similar Threads
sendRedirect()
Problem while connecting to Servlet
How to write to the servlet with standalone application
The concept of buffering in servlets
ResultSet not updateable Exception when using RowSet
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:39:14.