Chris
         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
parsing.

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

--Ramesh

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

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ramesh,

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgrIyoACgkQ9CaO5/Lv0PBzawCgty1MYNof9HGfv7m7mGV4QoFF
hHoAn2D978k1fVVYSjmcuj1GnvbEaXXl
=yKnR
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to