Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Correct DOCTYPE declaration example - it has to match the root element. See "Validity constraint: Root Element Type" in XML 1.0 spec (REC-xml-20081126). I am using this syntax in my server.xml files.

...

  • Use properties replacement so that in the xml config you have ${db.password} and in conf/catalina.properties you put the password there.
  • Since server.xml is an XML file — you can use XML entities. For example: "woot" becomes "woot" which is a way to obscure the password. You may even go through an extra layer of indirection by converting ${db.password} into XML entities so that the property replacement above is also performed. (But remember, while "clever, not more secure)
  • XML entities can be read from an external file. That is, add the following lines text at the top of server.xml just above after the XML declaration (<?xml ...?>) and before the <Server> element (line wraps can be removed):
No Format
<!DOCTYPE server-xmlServer [
  <!ENTITY resources SYSTEM "resources.txt">
]>

...