目录
1. 介绍
2. 根元素
3. 例子
4. 其他资源
介绍
jetty.xml是jetty的默认配置文件,通常放置是$JETTY_HOME/etc/jetty.xml, 通常jetty.xml配置如下信息:
* Server类(或它的继承类)和全局选项
* 线程池(最小、最大线程数)
* 连接器(端口、 超时时间、缓存大小、协议等)
* handler结构(默认handler和/或者 一个contextHandlerCollentions 等)
* deployment manager搜素和部署webapps和contexts
* 登陆service的权限检测
* 请求记录 request log
并不是所有的特性都要配置在jetty.xml中。有一些可选的配置文件和jetty.xml共享同一种配置格式。这些配置文件也存储在$JETTY_HOME/etc/下面, 他们的一个例子是 SVN Repository 由start.jar决定使用哪个配置文件,合并配置的过程在jetty.xml的使用说明中有描述。
Root Element 根元素
jetty.xml配置了 org.eclipse.jetty.server.Server的一个实例:
<?xml version="1.0"?> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> <Configure id="Server" class="org.eclipse.jetty.server.Server"> ... </Configure>
Examples 例子
$JETTY_HOME/etc 下面有默认的jetty.xml,也有其他的配置文件。这些配置文件可以通过命令行传给server。
Additional Resources 其他资源
- jetty.xml Tutorial–detailed tutorial that walks you through writing your own version of jetty.xml
- jetty.xml Syntax Reference–in-depth reference for Jetty-specific configuration XML syntax
- jetty-web.xml–configuration file for configuring a specific webapp