tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <>
Subject Re: Including a file into server.xml
Date Sun, 24 Jan 2010 14:02:35 GMT
On 23/01/2010 04:31, Aryeh M. Friedman wrote:
> I have an Java based XML DB that keeps track of different configurations
> for various sites we host and it is trivial to have it spit out a <Host>
> entery compatible with server.xml for each site... the only problem we
> have is how to insert the output into server.xml without garbaging
> and/or having to parse the file... the solution I want to use is
> "include file X here" but I can not find any way of coding that into
> server.xml.... If it is compatible with standard XML inclusion tag's
> just let me know and I will figure out the rest if not is there a
> special tag or something?

It is undocumented but you can use a standard form of XML include by 
defining an entity and then referencing it.

Add a doctype before the Server element as below.


<!DOCTYPE Server [
  <!ENTITY IncludedHosts SYSTEM "server-hosts.xml">
<Server port="8005" shutdown="SHUTDOWN">

   // etc ...

   <Service name="Catalina">

     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

     <Engine name="Catalina" defaultHost="">




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

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

View raw message