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
Win a copy of
Getting MEAN with Mongo, Express, Angular, and Node
this week in the
Joined: Oct 30, 2009
Mar 12, 2010 12:11:54
why can't we put the code in
(in place of Listener i.e
) 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
servlet and mapping declarations in web.xml
having trouble Initializing database connection from within ServletContextListener
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015