• 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 commitment

 
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,
I would like to be sure. Manning book SCWCD Exam Study Kit, p.109
Question 2:

Answer to question is: Assuming that getNameFromDBSomeHow() returns null, it will throw an IllegalStateException while serving request because when sendError is called, response is supposed to be commited and nothing may be written to the response once it is commited.
Now, in errata page for this book, we can read for this question:

Remove the line:
out.flush()


That is because this instruction enforces response to be commited, right?
So an answer to a precedent thread about resposne commitment would be:
when you see out.flush(); as instruction, you may say that the response is commited and so that in any case, you may call response.sendRedirect().
Am I right for this point?
Thanks for your response,
Regards,
Cyril.
 
cyril vidal
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, you should of course read at the end of the posr

so that in any case, you may NOT call response.sendRedirect() or response.sendError().

reply
    Bookmark Topic Watch Topic
  • New Topic