View Source

                                                                                                                                                                                                                                                                                                                                      *Back to [[Book|Administrator's Configuration File Reference#cfr]]     [[Topic|Administrator's Configuration File Reference#chap7]]*
h2. {{Input}} {anchor:int}

The {{Input}} directives allow you to select filters that will process incoming request data read by the {{Service}} stage. For more information, see [{{Input}}|Flow of Control in obj.conf#input].

The following {{Input}}-class filter is described in detail in this section:
* [#{{sed-request}}]

In addition, the following common SAFs are valid for the {{Input}} directive:
* [{{insert-filter}}|Common SAFs across Multiple Directives#saf1]
* [{{match-browser}}|Common SAFs across Multiple Directives#saf2]
* [{{remove-filter}}|Common SAFs across Multiple Directives#saf5]
* [{{set-variable}}|Common SAFs across Multiple Directives#saf8]

Every {{Input}} directive has the following optional parameters.

Table 7-71 Input Directive's Optional Parameters
||Optional Parameters ||Description ||
|{{type}} |(Optional) Specifies a wildcard pattern of MIME types for which this function will be executed. |
|{{method}} |(Optional) Specifies a wildcard pattern of HTTP methods for which this function will be executed. Common HTTP methods are {{GET}}, {{HEAD}}, and {{POST}}. |
|{{query}} |(Optional) Specifies a wildcard pattern of query strings for which this function will be executed. |

h3. {{sed-request}} {anchor:inp1}

The {{sed-request}} filter applies the {{sed}} edit commands to an incoming request entity body, for example, an uploaded file or submitted form.

h4. Parameters

The following table shows the {{sed-request}} parameters:

Table 7-72 {{sed-request}} Parameters
||Parameter ||Description ||
|{{sed}} |Specifies a {{sed}} command script. When multiple {{sed}} parameters are provided, the {{sed}} edit commands are evaluated in the order they appear. |

h4. Example

The following {{obj.conf}} code instructs {{sed-request}} to encode any ({{<}}) and ({{>}}) characters posted in an HTML form:
{code}
Input fn="insert-filter"
method="POST"
filter="sed-request"
sed="s/</\\</g"
sed="s/%3c/\\</g"
sed="s/%3C/\\</g"
sed="s/>/\\>/g"
sed="s/%3e/\\>/g"
sed="s/%3E/\\>/g"
{code}

Because {{POST}} bodies are usually URL-encoded, it is important to check for URL-encoded forms when editing {{POST}} bodies. {{%3C}} is the URL-encoded form of ({{<}}) and {{%3E}} is the URI-encoded form of ({{>}}).

h4. See Also
* [{{insert-filter}}|Common SAFs across Multiple Directives#saf1]
* [{{sed-response}}|Output#out3]

The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact