Hi,
I want to access the Context parameter set by the web.xml from a java bean
or simple java class. For example, If I have database connection details in
my web.xml and I want to get these in a Java Bean of a class which will pick
up the values and create a Connection object and return to the guy calling
it, either JSP or servlet.

I have a idea of using InitialContext class. But I doubt it works for
Context parameter defined in the web.xml.
It worked if I use like this for DataSource object which is created in my
application server.

   Context ctx  = new InitialContext();
   DataSource ds = (DataSource)ctx.lookup("OMSDataSource");
   return ds.DatabaseConnection.getConnection();

So how can I access a parameter like this..
<context-param>
     <param-name>Webmaster</param-name>
    <param-value>[EMAIL PROTECTED]</param-value>
</context-param>



Cheers.

Lakshmeenarayana G G
ArisGlobal India Development Center,
SysArris Software Pvt. Ltd.,
Bangalore, India
Tel:  91-80-665 4965 / 664 2690 / 6655052
Fax: 91-80-655 4285 / 665 0374
http://www.sysarris.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

Reply via email to