web xml file

Is it possible for a java class to access the web XML file. I have a web application where the servlets access some values from the web XML file for database username and password by calling the getServletConfig() function. My issue is that I have a flash component that calls on a Java class and I need that Java class to return a result set from the database so I need to access the web.xml file to get the database username and password.

I hope this makes sense.

Thanks for any help

[504 byte] By [morningJavaa] at [2007-11-27 6:44:54]
# 1

Yes the Java class can access the web.xml fil. It can access it like any other file on the system.

However you should be using JNDI datasources. The web app can create the datasourecin JNDI through configurations in the web.xml files. The Java class can access the JNDI InitialContext to get the datasource and connect to the database.

tolmanka at 2007-7-12 18:16:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...