Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet initialization

 
Jayashree Mohan
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
During initialization, the servlet instance can throw which exception.

A.ServletNotAvailableException
B.ServletException
C.UnavailableException
D.UnableToInitializeException

My answer was B. but the mock exam said it was C. Now which is rite and why ??Need some help on this.
 
Akshay Kiran
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
During initialization, the servlet instance can throw which exception.

A.ServletNotAvailableException
B.ServletException
C.UnavailableException
D.UnableToInitializeException

My answer was B. but the mock exam said it was C. Now which is rite and why ??Need some help on this.


SRV.2.3.2.1 Error Conditions on Initialization
During initialization, the servlet instance can throw an UnavailableException or a
ServletException. In this case, the servlet must not be placed into active service
and must be released by the servlet container. The destroy method is not called as it
is considered unsuccessful initialization.
A new instance may be instantiated and initialized by the container after a
failed initialization. The exception to this rule is when an UnavailableException
indicates a minimum time of unavailability, and the container must wait for the
period to pass before creating and initializing a new servlet instance.


Actually, i just looked up too. Unavailable exception is a subclass of ServletException.
but I think the mock exam should have allowed u to select two because the cause of the exception is not given.

thanks for bring it to my attention, I hadn't look at the specs yet LOL
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic