File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "The concept of buffering in servlets" Watch "The concept of buffering in servlets" New topic
Author

The concept of buffering in servlets

nebula kodatham
Greenhorn

Joined: Nov 10, 2005
Posts: 7
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

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="http://forums.hotjoe.com/forums/list.page" target="_blank" rel="nofollow">Java forums using Java software</a> - Come and help get them started.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

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

I am going to move this to the Servlets forum.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The concept of buffering in servlets