• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ Mock Exam

 
Srividhya Kiran
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When creating session listeners which are true? (Choose all that apply.)
A. They are all declared in the DD.
B. Not all of them must be declared in the DD.
C. The DD tag used to declare them is <listener>.
D. The DD tag used to declare them is <session-listener>.
E. The DD tag used to declare them is placed within the <web-app> tag.
F. The DD tag used to declare them is placed within the <servlet> tag.

Correct answer B & E. Why option C is not correct?

Thanks
Srividhya
 
Paul Brabban
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I guess it's just that if you don't declare all HttpSession listeners in the DD then the <listener> tag in the DD only declares some of them, not all.

Having said that if I saw this in the exam I would probably get it wrong! I hope that the questions in the exam are phrased more precisely.

Cheers,

Paul
 
Srividhya Kiran
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Same with me too
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpSessionBindingListener and HttpSessionActivationListener do not need to be declare in the web.xml.
They could have said : "C is wrong because only some of them are declared using the listener tag" :
C. The DD tag used to declare some of them is <listener>.

I find the answer to be "on the edge" though.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic