Introduction

This document describes the tags available for use in the programs configuration file and the available attributes.

Top

server

Main entry point for the HTTP server. Creates the server tree from a configuration file and runs it.

Valid children: reactor

Child of: None

Name Type Description Default
reactor CombinedReactor Sets the top level reactor that will be run after configuration. None

Reactor

reactor

Base implementation of a combined server/client reactor

Valid children: http

Child of: server

Name Type Description Default
statsInterval int Sets how often the statistics are dumped to the console. This interval is not a guaranteed. None

Server

http

Main Http server entry point.

Valid children: autoindex cache delegator error fallback files part stat velocity

Child of: reactor

Name Type Description Default
reactor CombinedReactor Bind this server to the given reactor. Used in configuration. None
port int Configure the TCP port to bind to. None
backlog int Configures the TCP server socket backlog limit. None

Interceptor

autoindex

An interceptor that will generate a pretty index of the requested directory.

Valid children: None

Child of: http cache delegator error target

Name Type Description Default
timestampFormat String Sets the SimpleDateFormat format used when displaying the directory. None
baseDir String Set the base directory. None

cache

Interceptor that may cache the response from a lower level interceptor.

Valid children: autoindex cache delegator error fallback files part stat velocity

Child of: http cache delegator error target

Name Type Description Default

delegator

Interceptor that delegates to child interceptors in the order that they were added.

Valid children: autoindex cache delegator error fallback files part stat velocity

Child of: http cache delegator error target

Name Type Description Default

error

Interceptor that serves an error document if the main path can't find anything. The main path will be given the first chance to handle the request. If the main path cannot then the error path is given a chance.

Valid children: autoindex cache delegator error fallback files part stat velocity

Child of: http cache delegator error target

Name Type Description Default
mainPath Interceptor Sets the root of the main path to go through. None
errorPath Interceptor Sets the root of the error path to go through. None

fallback

Last chance error handler that returns a simple HTML page.

Valid children: None

Child of: http cache delegator error target

Name Type Description Default
message String Set the message to return. Create a new fallback handler with the given message/message format. The parameters are:
  • {0} - The error code.
  • {1} - The path.
None

files

Interceptor that serves up files.

Valid children: extmap

Child of: http cache delegator error target

Name Type Description Default
baseDir String Set the base directory. None
directoryIndex String Sets the file that the server will try for if a directory is requested. Clears the list set by #addDirectoryIndex. None

part

Interceptor that hands off to a different child interceptor based on the original request. Can be used to re-map directories or to add servlets. Top down only. Does not handle conflicts.

Examples:

  • add('/foo/', ...) - hand off /foo/ and below.
  • add('/~', ...) - user dir like, hand off ~ and below.
  • /foo/bar.html - sub request for bar.html
  • ~michaelh/bar.html - sub request for michaelh/bar.html

Valid children: target

Child of: http cache delegator error target

Name Type Description Default

stat

Very simple statistics servlet. Adds 'stat' to the velocty context, which is a list of Stat objects.

Valid children: None

Child of: http cache delegator error target

Name Type Description Default

velocity

Interceptor that serves a Apache Velocity based template.

Valid children: None

Child of: http cache delegator error target

Name Type Description Default
lockedPath String Lock this interceptor to only ever return the contents of the given path no matter what the request. None

ExtMap

extmap

Extension to mime type mapping.

Valid children: None

Child of: files

Name Type Description Default
ext String Sets the extension to map from. None
type String Sets the mime type to map to None

Target

target

Helper class for configuration that encapsulates a (path, interceptor) pair.

Valid children: autoindex cache delegator error fallback files part stat velocity

Child of: part

Name Type Description Default
path String PENDING: setPath None