File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes The concept of buffering in servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "The concept of buffering in servlets" Watch "The concept of buffering in servlets" New topic

The concept of buffering in servlets

nebula kodatham

Joined: Nov 10, 2005
Posts: 7

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

Joined: Sep 23, 2004
Posts: 245
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?

<a href="" target="_blank" rel="nofollow">Java forums using Java software</a> - Come and help get them started.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Well right now your flushBuffer() call is remarked off.

I am going to move this to the Servlets forum.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: The concept of buffering in servlets
It's not a secret anymore!