Skip to Main Content
Tomcat: The Definitive Guide, 2nd Edition
book

Tomcat: The Definitive Guide, 2nd Edition

by Jason Brittain, Ian F. Darwin
October 2007
Intermediate to advanced content levelIntermediate to advanced
496 pages
16h 50m
English
O'Reilly Media, Inc.
Content preview from Tomcat: The Definitive Guide, 2nd Edition

catalina.properties

This configuration file was introduced in Tomcat 5.0 and is still present in Tomcat 6.0. The conf/catalina.properties file is a regular Java properties file. It sets some important class loader paths, security package lists, and some tunable performance properties. Another feature of the catalina.properties file is that you may set custom properties in this file and reference them as variables in Tomcat's server.xml file. For example, if you put this in catalina.properties:

# The HTTP port number.
http.port=8080

Then, in server.xml you can configure your connector using the http.port property by referencing it as ${http.port}:

<Connector port="${http.port}
"
           protocol="org.apache.coyote.http11.Http11Protocol"
           maxThreads="150" connectionTimeout="20000"
           redirectPort="8443"/>

This way, you may change any setting in catalina.properties that you would like to set that would otherwise require you to change server.xml.

By default, this property file has two properties that are used only when Tomcat's security manager is enabled: package.access and package.definition:

package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.a
pache.jasper.,sun.beans.
package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tom
cat.,org.apache.jasper.

They're configurable lists of packages that are only accessible by webapps, when the administrator has granted permissions for them to be used by modifying the catalina.policy file. Most users don't ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Apache Tomcat 7

Apache Tomcat 7

James Goodwill, Aleksa Vukotic
Java Servlet Programming, 2nd Edition

Java Servlet Programming, 2nd Edition

Jason Hunter, William Crawford

Publisher Resources

ISBN: 9780596101060Supplemental ContentErrata