• 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

SCWCD Mock Questions

 
Ranch Hand
Posts: 634
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic