Show TOC

Defining Custom HTTP Response Status CodesLocate this document in the navigation structure

Use

You can define custom HTTP response codes (in addition to the standard ones defined by the <HTTP 1.1 specification in RFC #2616>) that the Web Container uses to reply to the users of your Web application in certain cases. This option is available in the web-j2ee-engine.xml descriptor of your Web application.

Procedure

Open the web-j2ee-engine.xml file in the Developer Studio using the XML Editor and proceed as follows:

  1. Select the Design tab. In the context menu of the web-j2ee-engine node, choose Start of the navigation path Add Child Next navigation step response-status End of the navigation path.

  2. Expand the response-status node and fill in the status-code and reason-phrase fields.

  3. In the status-code field, enter the number of the error code that you want to define.

    Caution

    Make sure the number you specify differs from the standard ones already specified by the HTTP 1.1 specification. For more information about HTTP response status codes, see RFC #2616.

  4. In the reason-phrase field, enter a description of the code that describes the response status.