File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Joined: Oct 30, 2009
Mar 12, 2010 12:11:54
why can't we put the code in
(in place of Listener i.e ServletContextListener) to initialize the application with database DataSource that all the
please correct me if I'm wrong.
Author and ninkuma
Joined: Jan 10, 2002
Mar 12, 2010 12:14:26
You can. You can also use a hammer to drive in a screw. But it's the wrong tool for the job. Servlets are meant to respond to requests, context listeners are meant to perform setup. Use the right tool for the job.
Asking smart questions
Books by Bear
I agree. Here's the link:
subject: Regarding ServletContextListener
WA #1.....word association
how-to call some servlet or bean when war is loaded
Can not compile filter
Starting process threads when Tomcat starts
Loading the Properties file in a Web Application
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014