Handler Configuration Parameter Summary
Simple access control hander based on url prefixes or regexps.
- authName
- The name of the request.props entry to find a
white-space delimited list of url prefixes or
regular expression patterns. (defaults to "roles").
If the items in the list don't start with "/", then
the url prefix is prepended (only for prefix matching).
- prefix, suffix, glob, match
- Sepcify the URL that triggers this handler.
(See
MatchString
).
- redirect
- Name of the url to re-direct to if permission is denied.
If not specified, a simple message is sent to the client.
- useRegexp
- If provided, the list of credentials is interpreted as
regular expressions, otherwise url prefixes are used.
Connect to asterisk manager api.
- debug=true|false
- turn on more diagnostics on the console, depending on the current
server logging level. at "3", keep alives are logged, at "4", all events
are logged, and at "5" even more stuff is logged.
- isConnected
- This is set to "true" or "false" to indicate this handler's
opinion as to the state of the connection to the Asterisk server.
- keepalive=n
- If set, this handler will issue a keep-alive every "n"
seconds to the Asterisk Server. If the keep-alive fails,
a new connection will be attempted with the Asterisk server.
- queue
- The name of the Q to send manager commands to using the
<enqueue name="queue" ...>.
If not specifies, the "host:port" combination is used.
- retry=n
- Set the number of seconds to wait before retrying a broken
connection to an asterisk server (defaults to 10).
- server
- The server:port to use to contact the asterisk server
- userid, password
- The Manager credentials
The BSLTemplate
takes an HTML document with embedded "BSL"
markup tags in it and evaluates those special tags to produce a
standard HTML document.
- basematchelist.
- The list of matches (e.g. "1 2 3 ...").
- basematches
- The number of times the regular expression was matched.
- basesubmatches.
- The number of sub-expressions for this regular expression.
- debug
- If this configuration parameter is present, this template replaces
the BSL tags with comments, so the user can keep track of where
the dynamically generated content is coming from by examining the
comments in the resultant HTML document. By default, the BSL tags
are completely eliminated from the HTML document rather than changed
into comments.
The BasicAuthHandler
obtains a Session ID by performing
"basic" authentication, using either the "Authorization" or the
"Proxy-Authorization" headers.
- authenticate
- If specified, this is the response header that will be sent in the
HTTP error response if the user is not authenticated.
If this string is "", then this handler will
authenticate the request if the authorization header is present,
but will not send an HTTP error message if the request could
not be authenticated. This is useful if the web developer wants to
do something more complex (such as invoking an arbitrary set of
handlers) instead of just sending a simple error message if the
request was not authenticated. In this case, the web developer can
determine that the request was not authenticated because no
Session ID will be present in the request properties.
- authorization
- If specified, this is the request header that will contain the
"basic" authentication string, instead of the "Authorization"
or "Proxy-Authorization" header implied by
code
.
- code
- The type of authentication to perform. The default value is 401.
The value 401 corresponds to standard "basic" authentication.
The "Authorization" request header is supposed to contain the
authentication string. If the request was not authenticated, the
"WWW-Authenticate" header is sent in the HTTP error response
to cause the browser to prompt the client to authenticate.
The value 407 corresponds to "basic" proxy/firewall authentication.
The "Proxy-Authorization" request header is supposed to contain the
authentication string. If the request was not authenticated, the
"Proxy-Authenticate" header is sent in the HTTP error response
to cause the browser to prompt the client to authenticate.
Any other value may also be specified. Whatever the value, it will
be returned as the HTTP result code of the error message.
- ident
- The
ident
argument to SessionManager.getSession(java.lang.Object, java.lang.Object, java.lang.Class)
to get the table of valid sessions. The default value is
"authorized". If ident
is of the form
ident:session
, then the session
portion is used as the session
argument to
SessionManager.get(). Otherwise the session
argument is NULL. This table may be manipulated with the SetTemplate,
using the "ident" namespace and "session" for the
SetTemplate "sessionTable" parameter.
- mapFile
- If specified, this is the initial Session ID file.
This is expected to be
a java properties file, whose keys are the authentication tokens,
and whose values are the Session IDs that are inserted into the
request properties.
The keys in the file are basic authentication (base64) tokens with
any trailing "="
characters changed to "!"
.
- message
- The body of the HTTP authentication error message. This will be
displayed by the browser if the client chooses not to authenticate.
The default value is "". Patterns of the form ${xxx} are
replaced with the value of the xxx
entry of
request.props
.
- prefix, suffix, glob, match
- Sepcify the URL that triggers this handler.
- realm
- The "realm" of the HTTP authentication error message. This is a
string that the browser is supposed to present to the client when
asking the client the authenticate. It provides a human-friendly
name describing who wants the authentication.
- session
- The name of the request property that the Session ID will be stored
in, to be passed to downstream handlers. The default value is
"SessionID".
Start an "ssl" server.
- auth
- Require a valid client certificate (not useful).
- enable
- Must be set to "true" to turn on ssl server.
- password
- The certificate store password. If the password starts
with "@", the rest of the password is taken to be the name of the file
containing the password. "@-" causes the password to be read from stdin.
- sslport
- The port to start the server on. If no port is specified,
Then the existing server port is reused. Note: Do not use
a prefix when specifying this property, it is precicely "sslport".
- store
- The path name to the certificate keystore.
The BeanShellHandler
permits handlers to be written in "beanshell".
- debug
- If this configuration parameter is present, the
script
is re-read on each request, and a new interperter is
created and initialized. The call to init
is
deferred until request time, and called before each
call to respond
.
This allows beanshell scripts to be debugged interatively
from scratch.
- root
- The script directory, if the script is a relative file name.
If the "root" property under the prefix is not found,
the global "root" property is used. If the global "root"
property is not found, the current directory is used.
- script
- The name of the BeanShell script to use as the handler.
Normally, the script is read only once. (defaults to prefix.bsh)
The BeanShellServerTemplate
looks for one of the
starting tags
<server language="beanshell">
,
<beanshell>
, or
<bsh>
in an HTML page and treats the following data up to the corresponding
ending tag (
</server>
,
</beanshell>
, or
</bsh>
)
as a BeanShell script to evaluate.
- debug
- If this configuration parameter is present, this class
replaces the starting and ending tags with comments, so the
user can keep track of where the dynamically generated content
is coming from by examining the comments in the resultant HTML
document. By default, the starting and ending tags are
completely eliminated from the HTML document rather than
changed into comments.
- root
- The document root, if the script is a relative file name.
If the "root" property under the template prefix is not found,
the global "root" property is used. If the global "root"
property is not found, the current directory is used.
- script
- The name of the BeanShell script to evaluate when the
interpreter is created. This script is only evaluated when
the interpreter is created, not on every request. The
variables
prefix
and server
are set
before this file is evaluated, and are references to the
parameters passed to a handler
init method.
This is the Brazil Toolkit Servlet Adapter.
- context_path
- The servlet context path
- servlet_container
- The name of the servlet container
- servlet_name
- The servlet's name
- url.servlet
- The original URL requested by the client.
This SessionManager
associates an object with a Session ID
to give Handlers the ability to maintain state that lasts for the
duration of a session instead of just for the duration of a request.
- size
- The max number of entries in each table (defaults to 1000).
- tables
- The number of Hashtables in the pool (defaults to 6)
Handler for implementing cgi/1.1 interface.
- custom
- set to "true" to enable custom environment variables.
If set, all server properties starting with this handler's
prefix are placed into the environment with the name:
CONFIG_name
, where name is the
property key, in upper case, with the prefix removed.
This allows cgi scripts to be customized in the server's
configuration file.
- noheaders
-
According to the CGI spec, cgi documents are to begin with
properly formed http headers to specifie the type, return status
and optionally other meta information about the request.
if "noheaders" is specified, then the content is expected
to *not* have any http headers, and the content type is
as implied by the url suffix.
- prefix
- The prefix for all cgi files (e.g. /cgi-bin)
- root
- The document root for cgi files
- runwith
- The command to use to run scripts.
The absolute file path is added as the last
parameter. If not specified, the file name is run as the
command.
- suffix
- The suffix for cgi files (defaults to .cgi)
- url
- "o(riginal)" or "c(urrent)".
If an upstream handler has changed the URL, this specifes
which url to look for the cgi script relative to. The default
is to use the original url.
Allows multiple handlers to be invoked sequentially for a single HTTP
request.
- exitOnError
- If set, the server's
initFailure
will set
any of the handlers fail to
initialize. No handler prefix is required.
- handlers
- A list of
Handler
names that will be invoked in the
given order to handle the request. These are considered the
"wrapped" handlers. These handlers will all be initialized at
startup by init(sunlabs.brazil.server.Server, java.lang.String)
. For each name in the list, the property
name.class
is examined to determine which class
to use for this handler. Then name
is used as the prefix
in the handler's init() method.
- prefix, suffix, glob, match
- Specify the URL that triggers this handler.
- report
- If set, this property will be set to the name of the handler
that handled the request (e.g. returned true).
Variant of the chain handler for doing standard logging.
- flush
- The number of requests between flushes to the file
- logFile
- The name of the file to write the logs to.
This Template
adds an icon to HREFs to indicate when the
file being referred to is new, changed, or unchanged with respect
to the user's session.
- always
- If this property is present, the
ChangedTemplate
always
rewrites the HREFs, instead of just when they appear within the
<changed>
and </changed>
tags.
- changed
- The HTML to substitute into the document if the HREF refers to a
file that has changed since the last time it was accessed by the
user. If absent, the HREF for changed files will not be rewritten.
- fileName
- A request property containing the full path name of the current file,
used to keep track of the last time that file was accessed by the
current user. A
Handler
or other code may set this
property if it wishes the file to be tracked.
- new
- The HTML to substitute into the document if the HREF refers to a
file that has never been accessed by the user. If absent, the HREF
for new files will not be rewritten.
- root
- The root of the document hierarchy. An HREF must resolve to a file
in this hierarchy so its last-modified time can be checked. If the
file does not exist, the HREF will not be rewritten.
- unchanged
- The HTML to substitute into the document if the HREF refers to a
file that has not changed since the last time it was accessed by
the user. If absent, the HREF for unchanged files will not be
rewritten.
Handler for changing the group and owner of the server.
- groupName
- The name of the group to run as
- userName
- name of the user to run as
Handler for manipulating per-user session state that can be
represented as ASCII name/value pairs.
- default
- The default properties file to "seed" session properties
- glob
- Properties that match this "glob" pattern may be set
using the "set" pattern. If this property is specified,
the "default" property is optional.
- name
- The name of the config file. the first "%" is replaced
by the current SessionID.
- noContent
- a url, matching the "set" pattern that causes
a "204 no content" to be returned to the client
(not implemented).
- prefix
- The URL prefix required for all documents
- root
- The document root (no properties prefix required). If the
"name" or "default" properties don't start with a "/",
this is used as the current directory.
- set
- The url pattern to match setting properties.
Currently, it must also match "prefix".
Template class for extracting content out of remote html pages.
- all
- The entire content
- bodyArgs
- The attributes to the body tag, if any
- content-length
- The document content length, as fetched from the origin server
- content
- The body, delimited by content.../content>.
The text inside multiple <content>
... </content> pairs
are concatenated together.
- last-modified
- The document last modified time (if any) in std format
- link-[rel ]
- Every link tag "rel" and "href". Mulitple tags with the same "rel"
entriy are contatenated, using a space as the delimiter.
- meta-[name ]
- Every meta tag "name" and "content"
- prepend
- Prepend this string to the property names define above,
that are populated by this template. (defaults to "").
- referer
- The user agent referrer (if any)
- script
- All "<script>"..."</script>"
tags found in the document head
- scriptSrcs
- A white-space delimited list of all "src"
attributes found in "script" tags.
- style
- All "<style">..."</style">
tags found in the document head
- title
- The document title
- user-agent
- The origin user agent
The CookieFilter
keeps a
record of all the browser cookies associated with a given session.
- admin
- A URL prefix that causes status information to
be placed in the request properties.
- nosession
- The name of the session to use if no session
id is found. defaults to "common".
- session
- The request property to find the session id.
Defaults to "SessionID"
Handler for creating browser sessions using cookies.
- cookie
- the name of the cookie to use (defaults to "cookie").
- exist
- If specified, this means that the Session ID corresponding to the
cookie value must already exist in the
SessionManager
.
Normally, if the cookie was not present, a new cookie is
automatically created.
- map
- If specified, the
ident
argument to
SessionManager.getSession(java.lang.Object, java.lang.Object, java.lang.Class)
to get the table of valid
cookies, used to map the cookie value to a Session ID. By default,
the Session ID stored in the request is the cookie value itself.
- persist
- If set, cookies persist across browser sessions
- prefix, suffix, glob, match
- Specify the URL that triggers this handler
(See
MatchString
).
If prefix
is specified, it is also used to
instruct the client to limit the scope of the
browser cookie. to that prefix.
- session
- The name of the request property that the Session ID will be stored
in, to be passed to downstream handler. The default value is
"SessionID". If the property already exists, and is not empty,
no action will be taken.
Filter to save content (of an entire site) to a disk file.
- directoryName
- The root in the file system to save the content in
Template for including images inline, using data URL's.
- all=true
- Inline images if the "inline" tag is missing. If
"inline=false" is specified, the image is not inlined, even if
"all" is true.
- cache=n
- The number of images to cache (defaults to 50).
- force=true
- Don't use the cached version of the image. This
is useful when an image is changed on disk. "force" updates the cache
entry (if any) with the new image.
- max=n
- The max size (in bytes) for images to inline.
Template class for removing comments from html pages.
- disable
- if true, disable comment removal. This is checked at
each request.
Template class for printing stuff to stderr (for template debugging).
- debug
- If this configuration parameter is true, debugging is enabled.
Handler for appending a url ending with '/' into the appropriate
url based on a default file in the file system.
- defaults
- The names of the default files to search for in
the directory implied by the URL.
The first one that exists will
cause its name to be appended to the URL. Defaults
to "index.html".
- DirectoryName
- This property is set if the URL represents a valid
directory in the document root.
- fileName
- This property is set to the name of the default file,
if one was found.
- root
- The document root to look for files. If none is found with our
prefix, then "root" is examined. Defaults to ".".
Wrap another handler, deferring its initialization until request time.
- [handler.class]
- The name of the handler class.
- handler
- The token representing the handler to conditionally configure.
This is used as the handler's prefix
- requires
- The names of classes required to be resolvable before
configuring the handler
Handler or template for adding a delay into a response.
- delay
- The delay, in ms (defaults to 1000).
- prefix, suffix, match, glob
- Specify which url's to process.
Template for starting derby in network server mode.
- log
- If true, log connections
- port
- The port the server will listen on (defaults to 1527)
Sample handler for popping up a dialog box on the server.
- default
- The message to appear in the dialog box.
Defaults to Request from Client.
- denied
- The message to appear in the "permission denied" spot.
- prefix, suffix, glob, match
- Specify the URL that triggers this handler.
(See
MatchString
).
Perform digest authentication.
- [prefixusername
]
- If the user was validated, this field is filled out by the handler.
- allowBogusIE
- Internet Explorer does not use the query parameters as part
of the "uri" calculation. This is a bug (and a security risk, as
it allows replay attacts to other than the url requested). If this
variable is set, then query parameter in the URI challenge can
be ommited.
- credentials
- A java-properties format file of credentials. The keys are the
users, the values are either the "A1" values described above,
or the user's password.
- ident=ident:session
- Specifies the parameters to use in the SessionManager to store the
credentials data. This allows the credentials to be generated dynamically
using the SetTemplate.
(e.g. <set namespace="ident" name="admin" value="secret"> , where
the "session" portion of the
ident
value matches the
"SessionTable" setting for the SetTemplate). See the "samples" directory
for an examplew.
- isDynamic
- If set (to anything), when authentication for a user is requested
that is not in the credentials table and the credentials table has
changed since last read, the table is re-read, in case the user has been
added since the credentials were loaded.
- isProxy=true|false
- If true, use proxy athentication instead of origin server authentication.
- prefix, suffix, glob, match
- Specify which url's this handler applies to.
- realm
- The string presented to the user for validation. This must also
match any "digested" passwords.
This is a bare-bones handler for providing directory listings
for web servers.
- delim
- The delimeter separating the file names.
Defaults to a single space.
- DirectoryName
- This property is set by the
FileHandler
if the
URL it was passed resolves to a directory, but no
index file (e.g. index.html) was found.
- mime.xxx
- Only documents ending in ".xxx" are considered.
more than on mime.xxx parameters may be specified.
- prefix, suffix, glob, match
- Specify the URL that triggers this handler.
(See
MatchString
).
- setProps
- If present, no content is returned. Instead,
The properties "Directories" and "Files" are
set in the request properties, so the format of
the output may be generated dynamically.
[Note: This feature is deprecated, use the
DirectoryTemplate
instead].
Put current directory information (based on the URL) into the
request properties.
- [prepend.Directories]
- List of sub-directories in current directory
is set by this template.
- [prepend.Files ]
- List of files with valid suffixes in
current directory. is set by this template.
- debug
- if set, a comment is emitted indicating where the
file-list entitiy was encountered.
- delimiter
- Delimiter character to separate entries, defaults to " ".
- directory
- The directory to use instead of the one implied by the URL.
If it starts with "/", then it is resolved relative to the
document root, otherwise it is resolved relative to the
directory implied by the URL. The document root is
found in the porperty
"[prefix].root"
, or in
"root"
, or (if neither exists), the current
directory of the server.
- DirectoryName
- If set (usually by an upstream handler,
such as the FileHandler, or TemplateHandler),
this is used as the directory name instead of
deriving it from the URL.
- mime.xxx
- An indication that suffix "xxx" is valid.
Only valid file names are returned.
See
FileHandler
for a
description of how to set mime types for url suffixes.
- prepend
- String to prepend to the properties "Directories" and
"Files" That contain the directory and file lists respectively.
Defaults to the Templates properties prefix.
- select
- Specifies a "glob" pattern to restrict the names of
files and directories returned. The form "![pattern]" selects
the inverse of the glob pattern.
- stats
- If specified, then for each file, the properties:
[prepend].[file].mod and [prepend].[file].size
are set, containing the file last modified time
(seconds since epoch) and size (bytes) respectively.
The DynamicConfigHandler
allows the user to change the
configuration of the server and its handlers on the fly.
- config
- URLs beginning with this prefix can be used to upload or download
new configuration properties to this handler, which will also
dynamically change which sub-handler is installed. This property
belongs to the
DynamicConfigHandler
and is not
changed when new properties are uploaded. The default
is "/config/".
Properties may be uploaded by sending them as "name=value" pairs in
the body of a POST or in the "?" query parameters. The URL for
uploading properties is "config/set".
The current set of properties may be retrieved from this handler by
sending the URL "config/get"
- handler
- The name of the initial sub-handler that this
DynamicConfigHandler
will use to process requests. When
new properties are uploaded, the sub-handler will be replaced with
whatever is specified in the newly uploaded handler
property.
- prefix
- Only URLs beginning with this string will be redirected to the
sub-handler. This property belongs to the
DynamicConfigHandler
and is not changed when
new properties are uploaded. The default is "/".
Filter to Run all content through an external process filter.
- command
- The command to exec. The content is supplied as stdin, and
the filtered output is expected on stdout. ${...} substitutions
Are done at each filter invocation.
- error
- If the command failed, this property will contain the error
message. If the command generated output on stderr, this property
will contain the output.
- newType
- This property, if set, is used as the new content type.
It is evaluated for ${...} at each conversion.
- type
- This property is set to the content type of the content just
before command is evaluated.
- types
- A regular expression that matches the content types for the
content we wish to filter
template to exec a program, and return its arguments into request
properties .
- code
- The exit code for the program.
- error
- The error message, if something went wrong.
- stderr
- The standard error output produced by the program, converted to
a String using the default encoding.
- stdout
- The standard output produced by the program, converted to a String
using the default encoding.
Allow extracted content to be filtered through regular expressions.
- extract
- A regular expression to match the extracted content
- replace
- A regular expression substitution string used to
replace the content, if the expression matched.
- urlPrefix
- A prefix the url must match to be considered
for rewriting
The ExprPropsHandler
installs an expression evaluator as a
"smart properties" into the current request object, enabling arithmetic and
logical expression evaluation in property name lookups.
- prefix, suffix, glob, match
- Only URL's that match are allowed.
(See
MatchString
).
Handler for implementing Fast cgi/1.1 interface.
- env
- Lists tokens that represent additional environment variables
to pass to the fast fcgi process. They are of the form:
token1.name=..
token1.value=..
...
tokenn.name=..
tokenn.value=..
The values are interpreted for ${...} substitutions at each request.
- host:port
- Where to send the CGI requests to.
- noheaders
- If true, then no "http headers" are expected from the server.
- prefix
- Url's must match this prefix
- root
- This is the virtual document root passed to the CGI process.
If not supplied, the server's root is used instead, which is likely
to be useful only if the CGI process is running on the same machine.
- suffix
- The url must contain this suffix at the end of
a path component (e.g. at the end, or before a "/").
Standard handler for fetching static files.
- default
- The document to deliver
if the URL ends in "/". (defaults to index.html.)
- getOnly
- If defined, only "GET" requests will be processed. By
default, all request types are handled. (Note: this is the
inverse of the previous policy, defined by the undocumented
"allow" parameter).
- mime
- property for mime type
For each file suffix .XX, the property mime.XX is used to
determine the mime type. If no property exists (or its
value is "unknown", the document
will not be delivered.
- mimePatterns
- List of glob patterns that match file name suffixes
for matching mime types. For example:
mimePatterns=.x* .a?
mime.x*=text/xml
mime.a?=application/octet-stream
The types corrosponding to mime patterns are searched for
in mimePattern order, first looking for
prefix.mime.pattern
then
mime.pattern
. If neither property exists,
then the type is invalid.
- prefix
- Only url's that start with this are allowed.
defaults to "". The prefix is removed from the
url before looking it up in the file system.
So, if prefix is
/foo
then the the file
[root]/foo/bar.html
will be delivered
in response to the url /bar.html
.
- root
- property for document root (.)
Since the document root is common to many handlers, if no
root property is found with the supplied prefix, then the
root property with the empty prefix ("") is used instead.
This allows many handlers to share the common property.
- strictTypes
- If defined, only mime types specifically listed with
The file handlers prefix will be delivered.
The FilterHandler
captures the output of another
Handler
and allows the ouput to
be modified.
- exitOnError
- If set, the server's
initFailure
will set
any of the filters fail to
initialize. No handler prefix is required.
- filters
- A list of
Filter
names. The filters are applied in
the specified order to the output of the wrapped handler. For
each filter, the following properties are used:
-
class
: To find the filter implementation
-
prefix, suffix, glob, match, ignoreCase, invert
:
to determine which URL's are processed by this filter.
These properties are examined at each request, so "upstream"
filters can effect the inclusion/exclusion of downstream
filters.
See MatchString
for more information.
- handler
- The name of the
Handler
whose output will be captured
and then filtered. This is called the "wrapped handler".
- prefix, suffix, glob, match
- Specify the URL that triggers this handler.
(See
MatchString
).
- typePrefix
- If specified, only documents whose content-type starts with
"typePrefix" are filtered; all other content is returned directly to
the client. For example
typePrefix=text/html
causes
only html
documents to be considered for filtering.
"typePrefix" looks at the content type of the returned document, where
as "prefix" (and suffix...) look at the URL used to fetch it.
Handler for implementing a virtual web site.
- defaultPort
- Hormally all requests are fetched via "http", using the default
port of 80. The "protocol" and "defaultPort" settings may be used
to get other protocols. For example:
protocol=https
defaultPort=443
- headers
- A list of white space delimited tokens that refer to
additional HTTP headers that are added onto the polled
request. For each token the server properties
[token].name
and [token].value
define a new http header.
- host
- name of host site to proxy to.
- noErrorReturn
- If true, then if the proxy request fails, the response method
returns "false", and places the reason for failure in the "errorCode"
and "errorMsg" request properties.
Otherwise, and error response is generated. The default is (erroneously)
false for historical reasons.
- passHost
- If true, the original browser host string is passed to the
target, otherwise the mapped hostname is used, in which case the
http header "X-Host-Orig" will contain the original host name.
- port
- Host port to proxy to (defaults to defaultPort).
- prefix
- URL prefix must match
- protocol
- proxyHost
- Which proxy host to use (if any)
to contact "host".
- proxyPort
- The proxy's port (defaults to defaultPort)
The GroovyServerTemplate
looks for each
<groovy>
tag in an HTML page and treats the following data up to the next
</groovy>
)
tag as a groovy script to evaluate.
- debug
- If this configuration parameter is present, this class
replaces the
<groovy>
and
</groovy>
tags with comments, so the user
can keep track of where the dynamically generated content is coming
from by examining the comments in the resultant HTML document.
By default, the <groovy>
and
</groovy>
are completely eliminated from the
HTML document rather than changed into comments.
- root
- The document root, if the script is a relative file name.
If the "root" property under the template prefix is not found, the
global "root" property is used. If the global "root" property is
not found, the current directory is used.
- script
- The name of the Groovy script to evaluate when the interpreter is
created. This script only evaluated when the interp is created,
not on every request. The variables
prefix
and
server
are set before this file is evaluated, and
are references to the parameters passed to a handler
init method.
Rewrite text between markup (and not in links) based on re sub's.
- noCase
- true for case insensitive matches.
- sub
- The substitution pattern
- trailer
- Markup to add at end of document (before </body>)
Template class for highlighting text that matches a regular expression.
- exit
- If set, the template "init" method will
return false, and no further processing will
take place. This is useful if this template
is used by itself.
- highlight
- A regular expression that with match any text
between entities.
- matchCase
- If specifies, matches are case sensitive.
The default is to ignore case when matching.
- mustHighlight
- If not set, the entire document is surrounded
by implicit
highlight
tags. If set
no highlighting will take place until an actual
highlight
tag is present.
- options
- the set of name=value options that will be added
to the starting tag of the tag pair, above. The
default is "color=red".
- substitute
- The string to substitute for the matched text.
This is for advanced uses. If specified, the values
for
tag
and options
are
ignored. The default is:
<${tag} ${options}>&</${tag}>
The format of the string is a regular expression
substitution string, which supports ${} style
variable substitutions from the request properties.
- tag
- the html/xml tag pair that will be added before and
after all text maching "highlight", above. The
default is "<font> ..... </font>
The HistoryFilter
is both a Handler
and a
Filter
that keeps a record of all pages visited by a
given session.
- admin
- URLs beginning with this prefix cause the
HistoryFilter
to store the history information for the current Session in the
request properties
- filter
- If specified, then this is a
Regexp
pattern to match
against the "Content-Type" of the result. Setting this also implies
that the HistoryFilter
will be invoked as a
Filter
and not a Handler
. The default
value is "", which indicates that the "Content-Type" is not
examined and that this HistoryFilter
will be invoked
as a Handler
.
- nosession
- The Session ID to use if the Session ID was not specified. The
default value is "common".
- prefix
- This handler will only process URLs beginning with this string.
The default value is "", which matches all URLs.
- session
- The name of the request property that holds the Session ID. The
default value is "SessionID".
Handler for converting ~username queries.
- home
- The mount-point for home directories,
defaults to "/home/".
- prefix
- The url prefix used to identify home directory queries.
Defaults to "/~".
- root
- The name of the root property to set.
Defaults to "root".
- subdir
- Name of the directory in the user's home directory
that represents the user's "doc root"
Process a template file during server startup.
- file
- The file to use for the template for initial processing, relative
to the document root. Defaults to "init.template".
- prefix
- The name of the templateHandler or templateFilter configuration
prefix to share namespaces with. If this is not set properly, the
only shared namespace will be "server". For example, the following
server configuration fragment:
handlers=init ... template
init.class=sunlabs.brazil.sunlabs.InitTemplatesHandler
init.session=init
init.prefix=template
init.templates=set bsl ...
template.class=sunlabs.brazil.template.TemplateHandler
template.templates=set bsl ...
set.class=sunlabs.brazil.template.SetTemplate
would allow "init.template" to contain:
<set name=testing namespace=squirrel value=something>
and allow the TemplateHandler templates to see the variable "testing"
with markup like:
<import namespace=squirrel>
<get name=testing>
- session
- The name of the session for the template to use.
Defaults to "common".
- templates
- The list of templates (or template tokens)
to use for processing the template (required).
Handler to add the "https" protocol to HttpRequest.
- nopool
- If true, then no connection caching is done on
ssl sockets.
- trust
- If true, then all server connections are trusted.
This provides the equivalent functionality to the TrustMeHandler,
which is only used for the built-in HTTPs stack (e.g. FetchTemplate et el).
The JavaScriptTemplate
looks for each
<server language="javascript">
(or
<javascript>
)
tag in an HTML page and treats the following data up to the next
</server>
(or </javascript>
)
tag as a JavaScript script to evaluate.
- debug
- If this configuration parameter is present, this class
replaces the
<server>
and
</server>
tags with comments, so the user
can keep track of where the dynamically generated content is coming
from by examining the comments in the resultant HTML document.
By default, the <server>
and
</server>
are completely eliminated from the
HTML document rather than changed into comments.
- root
- The document root, if the script is a relative file name.
If the "root" property under the template prefix is not found, the
global "root" property is used. If the global "root" property is
not found, the current directory is used.
- script
- The name of the JavaScript script to evaluate when the interpreter is
created. This script is only evaluated when the interp is created,
not on every request. The variables
prefix
and
server
are set before this file is evaluated, and
are references to the parameters passed to a handler
init method.
Remove junk images from web pages.
- host
- The regular expression matching url's to reject.
If the expression starts with a '@', it interpreted as a
file name (minus the @) that contains a new-line separated
list of regular exporessions. See
Regexp
for more information on
regular expressions.
- image
- The file to contain the replacement image.
The LDAPTemplate
is invoked to process LDAP tags embedded in
a document.
- attributes
- The space-delimited list of attribute names to return from the
LDAP "dn" or "search" operation. If empty or unspecified, all
attributes for the record are returned. Not all records in the
LDAP database have the same attributes. Defaults to "".
- authenticate
- The Distinguished Name used for authenticating to the LDAP server,
if necessary. Defaults to "". This would be a good option to specify
in the configuration file rather than in the LDAP tag.
- base
- The Distinguished Name of the base record that forms the root of the
search tree in the LDAP database. Used only with the "search" option.
Defaults to "". This would be a good option to specify in the
configuration file rather than in the LDAP tag.
- dn
- The Distinguished Name (DN) to lookup in the LDAP server. The format
of a DN is described in RFC-1779. The "dn" and "search" options are
mutually exclusive. When "dn" is specified, only zero or one result
will be returned from the LDAP database. The result (if any) will be
stored in the request properties as follows:
<ldap dn="uid=6105,ou=people,o=WebAuth" prefix=name>
<property name.dn>
<property name.cn>
<property name.sn>
<property name.objectclass>
etc. The property name.dn
is the DN that was
found. Other properties will be defined as shown, based on the
attributes present in the LDAP record.
- host
- The hostname of the LDAP server, of the form
"host"
or "host:port"
if the server is not running on the
standard LDAP port. Defaults to "". This would be a good option to
specify in the configuration file rather than in the LDAP tag.
- limit
- The maxumum number of records returned. defaults to 1000.
- password
- The password sent when the "authenticate" option is used. Defaults
to "". If it begins with a '@',
The rest of the password is taken as the name of a file containing the
password. The password "@-" causes the password to be read from stdin.
- prefix
- The string prefix for the property names that will be stored
in the request properties to hold the results. If not specified,
defaults to the prefix of this template as specified in the
configuration file.
- scope
- The scope of the LDAP search, one of
- "base" Search only in base record (specified by the "base" option).
- "one" Search only records one level below the base record.
- "sub" Search the entire subtree below the base record.
Used only with the "search" option. Defaults to "sub". This would
be a good option to specify in the configuration file rather than in
the LDAP tag.
- search
- The search filter to use when searching the LDAP server. The format
of a search filter is described in RFC-1558. The "search" and "dn"
options are mutually exclusive. When "search" is specified, zero or
more results will be returned from the LDAP database. The results
will be stored in the request properties as follows:
<ldap search="(givenname=scott)" prefix=name>
<property name.rows>
<property name.rowcount>
<property name.0.dn>
<property name.0.cn>
<property name.0.mail>
<property name.1.dn>
<property name.1.cn>
<property name.1.pager>
etc. The property name.rows
is set to the list
of record indices found, and can be used by the BSL tag
<foreach name=x property=name.rows>
to
iterate over all records. Other properties will be defined for
each of the records found as shown, based on the attributes present
in the each of the LDAP records.
- timeout
- The maxumum time to wait for a response, in ms. Defaults to
30000 (30s).
Handler for logging information about requests.
- flush
- The number of lines of logging output that may be buffered in memory
before being written out to the log file. default to 25.
- format
- The format of the output string. Embedded strings of the form "%X"
are replaced, based on the following values for "X":
- %
A single "%"
- b
Bytes written to the client for this request.
- d
Time to service this request (ms).
- i
Client ip address.
- m
Request method (GET, POST, etc)
- M
Memory utilization (%).
- q
query string (if any)
- r
Requests used for this connection.
- s
HTTP result code.
- t
TimeStamp (ms since epoch).
- T
Number of active threads.
- u
URL for this request.
- v
HTTP protocol version (10 or 11).
Defaults to "%u;%t:%d:%b".
- handler
- The name of the handler to wrap. This can either be the token
for the class, or the class name itself.
- headers
- If specified This string is tacked onto the end of the "props"
string. Entries in the HTTPrequest headers may be included using
${...} substitutions.
- logFile
- The name of the file to log the output to. If the file already exists,
data is appended to it. If the file is removed, a new one is created.
If no name is specified, one is invented that contains the name and
port of the server. Unless an absolute path is specified,
the log file is placed in the current directory.
- props
- If specified This string is tacked onto the end of the "format"
string. Entries in the Request Properties may be included using
${...} substitutions.
- title
- if present, this is output as the first line of the file
Template class for defining macros.
- init
- The name of the file (or resource) to read a default set of
macro definitions from. If an
absolute path isn't specified, the file is taken relative to
the document root. The default macros are kept in the
SessionManager on a per-server basis. All macros defined
in the "init" file are global. All markup in this file outside
of a macro definition is ignored. If "subst" is present as
an attribute of a macro definition in this file, then all
${...} are evaluated relative to "server.props" before the
macro is defined.
- subst
- If specified, then any tags that are not processed by any
templates will have all ${..} contructs in attribute
values substituted. This subsumes the function of the
"SubstAllTemplate".
Utility class for handlers to determine, based on the URL,
if the current request should be processed.
- glob
- The glob pattern the url must match. If defined, this
overrides both
prefix
and suffix
.
- ignoreCase
- If present and
match
is defined, this causes the
regular expression match to be case insensitive. By default, case counts.
- invert
- If true, the sense of the comparison is reversed
- match
- The reqular expression pattern the url must match. If defined,
this overrides
glob
.
- prefix
- The url prefix the url must match (defaults to "/").
- suffix
- The url suffix the url must match (defaults to "").
Template class for computing last-modified
times
for content that is processed through templates.
- debug
- If this configuration parameter is present,
modified
tag is replaced by a comment. Otherwise it is removed from the document.
The MultiHostHandler
allows the user to handle a set
of host names that are all running on the same IP address.
- prefix.config
- Read in the file specified by "config" to initialize this sub-server's
server properties. The file is expected to be in java properties
format. If not specified, this sub-server shares a copy
of the main server's properties, otherwise, the main server's properties
are used as the "default". If this property is specified and no
config file is found, then the sub-server isn't started.
The property "root", if included in the "config" file, is treated
specially: If it does not represent an absolute path, then it is
resolved relative to the main server's root.
- prefix.handler
- The main handler for the server with the given prefix. If
this property is not specified, it defaults to the
FileHandler
.
- prefix.host
- Each server is started with a given prefix. The property
prefix.host specifies a Glob pattern for a virtual hostname
the server
will be expected to handle. If this property is not specified,
the server's virtual hostname will just be prefix.
If multiple host patterns could match a given "Host" header,
the first match in the "servers" list matches first.
- servers
- The list of prefixes for the other servers. Each server will be
initialized from the main
server.props
with the
specified prefix. In this way, the configuration parameters for
all the sub-servers can be stored in the same Properties
object.
Version of the SetTemplate that reflects form/multipart data
in Request.props.
- noEncode
- If present, no encoding is performed on file uploads.
- query
- If present, The form data is translated from form/multipart
and placed into the request properties, prefixed by the value
of
query
.
- saveName=name
- The name to use to save the file. May contain ${...}
substitutions. The variables ${fileName}, ${fieldName) and
${prefix} may be used here as "special" variables to make creating
a file name easier.
saveName
defaults to:
${prefix}-${fieldName}-${fileName}
- savePattern=[glob pattern
]
-
If set, then the form is scanned for field names that match
glob pattern. If a match is found, then the next
form element of type file is saved to a file in the document
root instead of being loaded as a property. The name of the
file is specified by the value of the
saveName
entry.
Sample template class for removing all images
from a web page, and replacing them with their alt strings.
- template
- The text used to replace the image. The first "%" will contain the image
"alt" string, if any.
Handler for returning "file not found" errors back to the client.
- fileName
- The name of the file to send for missing files.
Defaults to "notfound.html"
- prefix, suffix, glob, match
- Specify the URL that triggers this handler.
(See
MatchString
).
- root
- The location of the document root for locating the
default "not found" file (also looks using prefix of "").
- type
- The file type, defaults to text/html
Rewrite text between markup (and not in links) based on re sub's
- re
- regular 'phone' expression.
- re
- regular 'phone' expression. Phone Expressions are simplified
regular expressions:
- N Any digit
- [space] zero or more spaces
- | logical or
- anything else - itself
- sub
- substitution
- trailer
- to add at end of document (before