As a rule, you should not rely on system properties to configure webapp - they can be used to configure a container (for example, Tomcat), but not for an application running inside tomcat.
cliff.meyers has already mentioned how best to use your web application. This is the standard way, which is also suitable for your setup question through context.xml or server.xml.
However, if you really need system properties or other jvm parameters (for example, maximum memory settings) in tomcat, you must create a file called "bin / setenv.sh" or "bin / setenv.bat". These files do not exist in the downloadable standard archive, but if they are present, the contents are executed at startup (if you run tomcat through startup.sh/startup.bat). This is a great way to separate your own settings from tomcat default settings and make updating easier. No need to configure startup.sh or catalina.sh.
(If you are running tomcat as a windows service, you usually use tomcat5w.exe, tomcat6w.exe, etc. to configure registry settings for this service.)
EDIT: Also, another possibility is to upgrade to JNDI Resources .
Olaf Kock Dec 28 '08 at 14:49 2008-12-28 14:49
source share