If a Server Application Function results in an error, it sets the HTTP response status code and returns the value REQ_ABORTED. When this happens, the server stops processing the request. Instead, it 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 JavaTM 2 Platform, Enterprise Edition (J2EETM platform) applications and modules deployed to the Sun Java System Web Proxy Server. This 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 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 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.file name
The following table describes parameters for the error-j2ee function.
Table 5–121 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–122 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–123 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. This allows the server to present a friendly message describing the problem. The HTML page may contain images and links to the server’s home page or other pages.
The following table describes parameters for the send-error function.
Table 5–124 send-error parameters
Error fn=send-error code=401 path=/sun/proxyserver40/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.