Tomcat 4.1.24 configuration settings

This is a discussion on Tomcat 4.1.24 configuration settings within the Apache Web Server forums, part of the Web Server and Related Forums category; I am trying to write a Java-based web application. I am using Tomcat 4.1.24 as my servlet/...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-29-2003
Paul Ackerman
 
Posts: n/a
Default Tomcat 4.1.24 configuration settings

I am trying to write a Java-based web application. I am
using Tomcat 4.1.24 as my servlet/JSP engine. The
application uses MySQL.

My question is this: I want to use two databases, one for
production, one for testing. I have two directories under
the webapps directory, prod and test. I want the
application to know which directory it is in and point to
its respective database. Is there a way to do this using
the directory name? Or should I read it out of a file, like
web.xml?

I have tried to parse my own XML file, but the application
will only read out of the $CATALINA_HOME\bin directory. I
can't seem to get it to read a file from the home directory
of the application.

I haven't tried using JNDI or DataSources yet because it
looks like they use the server.xml file. If I used that I
think I would still have a problem of not being able to
decide which entry to use.

I currently have only one version of Tomcat running. Do I
need to run another Tomcat instance to make this work? If
so, how does the application know which version of Tomcat to
use?

Thank you in advance for your assistance.

- Paul Ackerman
pgackerman@email.com



  #2 (permalink)  
Old 07-29-2003
Davide Bianchi
 
Posts: n/a
Default Re: Tomcat 4.1.24 configuration settings

In alt.apache.configuration Paul Ackerman <pgackerman@email.com> wrote:
> its respective database. Is there a way to do this using
> the directory name? Or should I read it out of a file, like
> web.xml?


You'd better put the database connection url in some kind of
configuration file and then refer to that in the code. This way
no matter the name of the directory and you can easily change the
database later.

See the documentation for the Servlet package and the Properties
class.

Davide
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:57 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0