Bonjour,
j'aimerais savoir si c'est possible récupérer les valeurs définies dans mon fichier
web.xml comme suit:
à n'importe quel moment?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20<context-param> <param-name>pro_dbriver</param-name> <param-value>com.mysql.jdbc.Driver</param-value> </context-param> <context-param> <param-name>pro_dburl</param-name> <param-value>jdbc:mysql://localhost:3306/formacion</param-value> </context-param> <context-param> <param-name>pro_dblogin</param-name> <param-value>formacion</param-value> </context-param> <context-param> <param-name>pro_dbpassword</param-name> <param-value>formacion</param-value> </context-param> <listener> <listener-class>dao.login.LoginDAOImpl</listener-class> </listener>
dans ma classe qui implémente ServletContextListener je fais:
j'ai fais un peux de recherche mais je ne trouve pas comment initialiser ma variable sce et encore si ce que je veux faire est possible....
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 static{ ServletContextEvent sce; ServletContext application = sce.getServletContext(); }
Je vous remercie d'avance pour vos réponse.
Partager