commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Dudley <>
Subject XMLConfiguration: Editing Root Node
Date Tue, 01 Jun 2010 23:32:23 GMT

I'm attempting to use XMLConfiguration to edit the Tomcat server.xml 
file.  I created a fragment with which to test:

<Server port="8005" shutdown="SHUTDOWN">
  <Service name="Catalina">
    <Connector connectionTimeout="20000" port="80" protocol="HTTP/1.1" 

The following snippet first reads the Connector port and then sets both 
the Server and Connector ports to values based on same.

            XMLConfiguration xml = new 
            int port = 
TFormatter.parseInt(xml.getString("Service.Connector[@port]"));  //80;
            xml.setProperty("[@port]", String.valueOf(6100+port));
            // if i display the two properties at this point, they are 
as expected - 6180 and 6080

The save does no overwrite the Server port.  It remains set to 8005.

What am I missing?

Many thanks.

Scott Dudley

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message