Hello friends, I am confused. Servlets and JSP both do the same thing then in actual web development do we use Servlets. Where are listeners and filters used, even we can work out without them? Kindly guide. Thanks in advance
Poornima Sharma ---- So to get a database connection what should I use a servlet/listener/jsp. I cant get the best
You can use a listener (class which implements ServletContextListener) to create a DataSource and make it available to other parts of your web application (i.e: storing in the ServletContext) at the startup.