sunlabs.brazil.template

Class MultipartSetTemplate

public class MultipartSetTemplate extends SetTemplate

Version of the SetTemplate that reflects form/multipart data in Request.props. For ordinary forms, the values placed into request.props are the same as for forms of type www-url-encoded, or method=get, as long as the query option is set.

For file input fields (e.g. <input type=file...>), the file content is associated with the field name, and the properties name.filename, name.type, and name.encoding are set to to the name of the file uploaded, its type, and (unless noEncode is set), the encoding, which is either none (for text files), or Base64.

The file contents are automatically Base64 encoded for binary files.

Properties:

query
If present, The form data is translated from form/multipart and placed into the request properties, prefixed by the value of query.
noEncode
If present, no encoding is performed on file uploads.
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.
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. saveNamedefaults to: ${prefix}-${fieldName}-${fileName}
[This has only been tested with Netscape Navigator and Mozilla.]

Version: %W

Author: Stephen Uhler

Method Summary
booleaninit(RewriteContext hr)
voidtag_get(RewriteContext hr)
voidtag_import(RewriteContext hr)
voidtag_property(RewriteContext hr)
voidtag_set(RewriteContext hr)
voidtag_slash_tag(RewriteContext hr)
voidtag_tag(RewriteContext hr)

Method Detail

init

public boolean init(RewriteContext hr)

tag_get

public void tag_get(RewriteContext hr)

tag_import

public void tag_import(RewriteContext hr)

tag_property

public void tag_property(RewriteContext hr)

tag_set

public void tag_set(RewriteContext hr)

tag_slash_tag

public void tag_slash_tag(RewriteContext hr)

tag_tag

public void tag_tag(RewriteContext hr)