Servlet init parameters are passed to a web application in the web.xml
file. Below is an example I use to pass the class name of the jdbc
driver to use to my servlets.
<context-param>
<param-name>dbclassname</param-name>
<param-value>jdbc.driver.class.name</param-value>
<description>The JDBC Driver to use</description>
</context-param>
I can now access the value of dbclassname whereever I want in my servlet
like this : getServletContext().getInitparameter("dbclassname")
Hope this helps,
[ Matthias Carlsson ]
[ Programmer (Java, CGI/Perl, Javascript, HTML) ] [ Web Designer ]
[ E-Mail : [EMAIL PROTECTED] ] [ ICQ: 1430647 ]
[ http://home1.swipnet.se/~w-18931/programming/ ]
-----Ursprungligt meddelande-----
Fr�n: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]F�r Boda,
Ramakrishna Rao (Ramakrishna)
Skickat: den 22 november 2000 14:15
Till: [EMAIL PROTECTED]
�mne: How to pass initialisation paramters to Servelt in Apache+Tomcat ?
Hi !
How can I pass the init paramters to Servlets .
I am using Apache 1.3.12 and Tomcat 3.2b8 .
Thanks
Boda
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html