Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServletContextListener !!!

 
Amitkumar Dhama
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Can anybody help me out in getting these mock questions?

1st question is:
servletContextListner is called if
a.Context is loaded
b.Context is initialized or destroyed

I found option �a� correct in one mock, and in another mock it is given that b is correct..
Please let me know which one to choose�.

2nd question is:
where should the element <taglib-uri>***</taglib-uri> be present
a.Web application
b.TLD
c.DTD
d.Custom tag class



Thanking in advance�
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

1st question is:
servletContextListner is called if
a. Context is loaded
b. Context is initialized or destroyed

I found option �a� correct in one mock, and in another mock it is given that b is correct..
Please let me know which one to choose�.

2nd question is:
where should the element <taglib-uri>***</taglib-uri> be present
a. Web application
b. TLD
c. DTD
d. Custom tag class


The ServletContextListener is called at the time of initialize and destroy of context. I think loading of context is broad term. The contextInitialized method of this listener is called at the time of initialization of context and at the time of destruction the contextDestroyed method is called.

<taglib-uri> element should be present in DTD that is web.xml under <jsp-config> element. But this element is not required as per Servlet Specificatin 2.4

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic