struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samuel Rochas <samuel.roc...@andinasoft.com>
Subject Database access in contextInitialized
Date Wed, 28 Apr 2004 17:15:43 GMT
Hello Struts Gurus,

I am starting with struts.
I used to make some initialization in my Servlets using the init() 
method. With struts, I just implemented the contextInitialized method of 
ServletContextListener Interface, and I have a place for such 
initializations. Fine.

The things I used to initialize were some Collections with data from a 
database. With struts, I am now using the datasource configuration in 
struts-config.xml and I access it in my Actions with: 
getDataSource(request). Fine too.

But, I don't have access to getDataSource() in my ServletContextListener 
implementation. So how can I access my database there, the same way I 
access it in the rest of the application?

Thanx in advance
Samuel

---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18 ---- Cel. +593 9 946 4046
---------  http://www.andinasoft.com  ---------

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message