• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Response Commited

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,

can anyone tell me what exactly are the situations that makes the response considered to be commited?
 
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Commited is database programming, Web Component Certification has to do with Servlet and so on. That is at least what I found in a three minute effort. What is Response Commited in Sun Certified Web Component Developer for the Java Platform, Enterprise Edition 5 (CX-310-083)?

I am sure I understand your question, you are asking when the activity of the Web Component is complete. I am responding that Response Commited is database programming.
 
Hussam Odeh
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nicholas Jordan:
Commited is database programming, Web Component Certification has to do with Servlet and so on. That is at least what I found in a three minute effort. What is Response Commited in Sun Certified Web Component Developer for the Java Platform, Enterprise Edition 5 (CX-310-083)?

I am sure I understand your question, you are asking when the activity of the Web Component is complete. I am responding that Response Commited is database programming.



Hi Nicholas,

I read a note in HFSJ book second edition (page 207), it says that you cant forward the request if you've already committed a response, my question was when the response is considered to be committed, its not about the database like when you commit a transactions on the database, no, its about the response.

I hope you understand my question.

Many thanks for you reply.
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I saw something like that recently - it has to do with headers and so on. I can look it up for you: I have Marty Hall's book. The 'committed' you speak of has someting to do with - I am needful of going back and will probably have to fix my statement but you have to do the header stuff BEFORE you get the PrintWriter ( or possibly before you write anything to it )

Standard out { System.out in Java terminology } is obtained by a method call for the Response object and will be documented - Once you write to the browser, buffering and so on is such that changing headers at that point will not work.

We can thus use the nomenclature 'committed' and I would think this is what the authors likely intended. I do not have a copy of that book. A very short citation from the text of a sentence or two to show the question, with a full explaination of what your question is would likely serve clarity for all. Writing a book is like that, and these questions make their job easier. Please elaborate.
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the Servlet Spec. it seems like it depends on the container (buffering, buffer size). Here is a quote from the specification, SRV.5.1:


The isCommitted method returns a boolean value indicating whether any
response bytes have been returned to the client.

 
Hussam Odeh
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello mates,

my point in this question is to clear a big doubt in a question i solved in chapter 5 (HFSJ the first question) which is:

When using a RequestDispatcher, the use of which methods can often lead to an IllegalStateException?

A- read
B- flush
C- write
D- getOutputStream
E- getResourceAsStream

my answer was (B), but the book mentioned that the answer is (B & C).

I wrote a code to see if the write method cause this exception, but it didnt, only the flush method did this exception.

I hope I managed to clarify my question.

Do anyone have any explanation about this?

[ June 02, 2008: Message edited by: Hussam Odeh ]
[ June 02, 2008: Message edited by: Hussam Odeh ]
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We need to get some testing help, there may be differing responses in implementations. That is hard to deal with in a book. There are short-code weaknesses in what I hammered out in two or three minutes, and others may have improvements right away, but we need to get several responses on this rather than trying to hash it out on one or two observations.


[ June 02, 2008: Message edited by: Nicholas Jordan ]
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Hussam Odeh:
I wrote a code to see if the write method cause this exception, but it didnt, only the flush method did this exception.


write won't always cause it... but it could.

I wrote a ditty on autoFlush a little over a year ago that explains this in greater detail.

Enjoy!
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well this ought be trapped somewhere,....

Consistent behaviour is necessary for writing books.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look at SRV.5.1 in the servlet spec (link in my signature).


The isCommitted method returns a boolean value indicating whether any
response bytes have been returned to the client. The flushBuffer method forces
content in the buffer to be written to the client.

 
reply
    Bookmark Topic Watch Topic
  • New Topic