tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramesh Narayanan (ramesnar)" <>
Subject RE: internal tomcat server.xml parsing
Date Wed, 14 May 2008 17:43:47 GMT
         Thanks for your reply. I was thinking the Tomcat would parse
the XML and store it in its internal datastructures/beans but how
terribly wrong I am! I also thought about using JMX to load/reload these
properties once parsed from server.xml file. I was scourging the tomcat
API documentation yesterday and I knew it used Commons digester to parse
the config file, but I didn't knew it didn't  build java objects after

So, I understand, the good old kludgy String manipulation is the ONLY
good approach here and here I am off to do that stuff.


-----Original Message-----
From: Christopher Schultz [] 
Sent: Wednesday, May 14, 2008 10:37 AM
To: Tomcat Users List
Subject: Re: internal tomcat server.xml parsing

Hash: SHA1


Ramesh Narayanan (ramesnar) wrote:
| Has anyone ventured into modifying the conf/server.xml file using the
| default internal XML parser of tomcat?

IIRC, Tomcat uses commons-digester to load its XML configuration. The
digester does not have POJO->XML capabilities, so you'll have to build
them yourself.

| I am currently in a midst of a project where I am securing all in
| bound and out bound communications and to that effect I have
| generated a SSL certificate using our CA and when I configure
| manually the new keystore, keypass, truststore, trust password,
| everything works like a charm. I need the capability to just go and
| change these attribs at run time and restart the tomcat server and
| want the new cert to load.

I would recommend parameterizing the server.xml file and using simple
string replacement rather than re-parsing the server.xml file each time
and re-writing the entire thing. This will allow you to keep comments
and leave unexpected elements untouched.

- -chris

Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message