Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The concept of buffering in servlets

 
nebula kodatham
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Scott Dunbar
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well right now your flushBuffer() call is remarked off.

I am going to move this to the Servlets forum.

Mark
 
nebula kodatham
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13077
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
nebula kodatham
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic