If a Server Application Function results in an error, it sets the HTTP response status code and returns the value REQ_ABORTED. The server then stops processing the request. Instead, the server searches for an Error directive matching the HTTP response status code or its associated reason phrase, and executes the directive’s function. If the server does not find a matching Error directive, it returns the response status code to the client.
The following Error-class functions are described in detail in this section:
error-j2ee handles errors that occur during execution of the Java 2 Platform Enterprise Edition (J2EETM platform) applications and modules deployed to the Sun Java System Web Proxy Server. This function is applicable only to the Administration Server.
match-browser matches specific strings in the User-Agent string supplied by the browser, and then modifies the behavior of the Sun Java System Web Proxy Server based upon the results by setting values for specified variables.
query-handler runs a CGI program instead of referencing the path requested.
remove-filter removes a filter from the filter stack.
send-error sends an HTML file to the client in place of a specific HTTP response status.
set-variable enables you to change server settings based upon conditional information in a request, and to manipulate variables in parameter blocks by using specific commands.
This function is applicable only to the Administration Server.
Applicable in Error-class directives.
The error-j2ee function handles errors that occur during execution of web applications deployed to the Sun Java System Web Proxy Server individually or as part of full J2EE applications.
The following table describes the parameter for the error-j2ee function.
Table 5–130 error-j2ee Parameters
Parameter |
Description |
---|---|
bucket |
(Optional) Common to all obj.conf functions. |
See match-browser.
Applicable in Service- and Error-class directives.
This function is provided for backward compatibility only and is used mainly to support the obsolete ISINDEX tag. If possible, use an HTML form instead.
The query-handler function runs a CGI program instead of referencing the path requested.
The following table describes parameters for the query-handler function.
Table 5–131 query-handler Parameters
Error query=* fn=query-handler path=/http/cgi/do-grep Error query=* fn=query-handler path=/http/cgi/proc-info |
Applicable in Input-, Output-, Service-, and Error-class directives.
The remove-filter SAF is used to remove a filter from the filter stack. If the filter has been inserted multiple times, only the topmost instance is removed. In general, it is not necessary to remove filters with remove-filter, as they will be removed automatically at the end of the request.
Returns REQ_PROCEED if the specified filter was removed successfully, or REQ_NOACTION if the specified filter was not part of the filter stack. Any other return value indicates an error.
The following table describes parameters for the remove-filter function.
Table 5–132 remove-filter Parameters
Parameter |
Description |
---|---|
filter |
Specifies the name of the filter to remove. |
bucket |
(Optional) Common to all obj.conf functions. |
Error fn="remove-filter" filter="http-compression" |
Applicable in Error-class directives.
The send-error function sends an HTML file to the client in place of a specific HTTP response status. The server can therefore present an explanatory message describing the problem. The HTML page may contain images and links to the server’s home page or other pages.
The send-error function can be used to configure messages from the proxy server only and does not work for configuring messages in place of HTTP responses from web server.
The following table describes parameters for the send-error function.
Table 5–133 send-error Parameters
Error fn=send-error code=401 path=/sun/server61/docs/errors/401.html |
Applicable in all stage directives. The set-variable SAF enables you to change server settings based upon conditional information in a request, and to manipulate variables in parameter blocks by using specific commands. See set-variable.