I am confused about below : ( from chapter 5 of HFSJ)
Why we required ServletContextListner ( as we used for Dog example in book) if we could use dog as context attribute also ? OR Both will serve the same purpose ?
[for sure if we use it as context attribute , then it will have threading issue ], what other reasons could be?
Thanks Vishal Chugh
posted 8 years ago
ServletContextListener - Use this listener when you want to get notifications for ServletContext Created and servlet context destroyed.
ServletContextAttributeListener - Use this listener when you want to get notifications for when any code adds/remove/replaces an attribute to servlet context via ServletContext.addAttribute() or ServletContext.removeAttribute()
Both are completely different. I will suggest you to try few examples and you will know the difference.
SCJP, SCWCD, SCBCD
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads