• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

sendError qn in j2eecertificate

 
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am attended the following qn in j2eecertificate demo exam.
What is the answer for this qn.

Which of the following statements regarding the sendError response method are true? [Check all correct answers]

1. sendError accepts java.lang.Throwable as an argument.
2. sendError can throw java.lang.IllegalStateException.
3. sendError has the side effect of committing the response.
4. sendError is only used to set the return status code when there is no error.
5. sendError throws an java.lang.InvalidStateException if the response has already been committed.

the answer given is 2 3 how it is?
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Refer to the HttpServletResponse.sendError(...) documentation in the spec.

"If the response has already been committed, this method throws an Illegal-
StateException. After using this method, the response should be considered
to be committed and should not be written to."
 
You have to be odd to be #1 - Seuss. An odd little ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic