• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SCWCD Mock Questions

 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javabeat


I find the answers of the following 2 mock questions ambiguous.

q1.
Assuming that the Servlet Container has just called the destroy() method of a servlet instance, which of the following statements are correct?
Select 2 correct options.

A.Any resources that this servlet might hold have been released.
B.The servlet container time out has exceeded for this servlet instance.
C.The init() method has been called on this instance.
D.None of the requests can EVER be serviced by this instance.
E.All threads created by this servlet are done.

correct answer:C,D

I think answers should be:A,E

-------------------------------------------------------------------------------------------
q2.
For a tag to accept any valid jsp code as its body, what should be the value of <body-content> for this tag's taglib descriptor?
Select 1 correct option.

A.JSP
B.jsp
C.any
D.text
E.The <body-content> subelement itself may be absent.

correct answer:JSP
I think answer should A and E both
 
Ricardo EspĂ­rito Santo
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there,

Q1 You may have used a recordset for example and forgot to do a close() on it therefore A cannot be right. Also I may created a thread in my servlet and left it hanging with some work or even just sleeping without it being trashed.

While you can be sure that if the destroy() just executed then the servlet must have gonne throught its lifecycles being init() one of them.

The answer D leaves me puzzled since there is only once servlet instance by the jvm I thought the container would reuse the servlet instances...

Q2 Only one can be right and by default (i.e.: missing the body-content element) is scriptless.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic