On Thu, 17 Jan 2002, Gerry Scheetz wrote: > I was wondering if it is possible to have the same servlet running twice = > under a single instance of Tomcat. > > I am running Tomcat 3.2, but could upgrade to Tomcat 4.0. > > What I want to do is be able to access 2 different databases through the = > same servlet code. So http://localhost/ProdApp would run against a = > production database and http://localhost/TestApp would run against a test = > database. My database connection information is stored in the web.xml = > file and I assume if this is possible the web.xml file is what I need to = > manipulate. I just don't want to spend hours working on this if it is not = > possible.
Trivial to do. Just set up two separate servlet definitions in web.xml that use the same servlet-class, and call them (i.e. in the URL) by the different servlet-name's you assign to them. You can even set up servlet-mapping's for them if you want to call them by other URLs. Milt Epstein Research Programmer Software/Systems Development Group Computing and Communications Services Office (CCSO) University of Illinois at Urbana-Champaign (UIUC) [EMAIL PROTECTED] ___________________________________________________________________________ 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
