## org.mortbay.http.handler
Class SetResponseHeadersHandler

    java.lang.Object
      |
      +--org.mortbay.http.handler.AbstractHttpHandler
            |
            +--org.mortbay.http.handler.SetResponseHeadersHandler

All Implemented Interfaces:
  HttpHandler, LifeCycle, java.io.Serializable

public class SetResponseHeadersHandler
extends AbstractHttpHandler

Handler that allows arbitrary HTTP Header values to be set in the response.

Version:
  $Id: SetResponseHeadersHandler.java,v 1.1 2003/02/10 00:38:51 bretts Exp $
Author:
  Brett Sealey
See Also:
  Serialized Form

Constructor Summary
`SetResponseHeadersHandler()`

Method Summary
`void` `handle(java.lang.String pathInContext, java.lang.String pathParams, HttpRequest request, HttpResponse response)` Handle a request by pre-populating the headers from the configured set of _fields.
`void` `setHeaderValue(java.lang.String name, java.lang.String value)` Set a header override, every response handled will have this header set.
`void` `setHeaderValues(java.lang.String name, java.lang.String[] values)` Set a multivalued header, every response handled will have this header set with the provided values.

Methods inherited from class org.mortbay.http.handler.AbstractHttpHandler
`getHttpContext, getName, handleTrace, initialize, isStarted, setName, start, stop, toString`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### SetResponseHeadersHandler

    public SetResponseHeadersHandler()

Method Detail

### setHeaderValue

    public void setHeaderValue(java.lang.String name,
                               java.lang.String value)

  Set a header override, every response handled will have this header set.

  Parameters:
    `name` - The String name of the header.
    `value` - The String value of the header.

### setHeaderValues

    public void setHeaderValues(java.lang.String name,
                                java.lang.String[] values)

  Set a multivalued header, every response handled will have this header set with the provided values.

  Parameters:
    `name` - The String name of the header.
    `values` - An Array of String values to use as the values for a Header.

### handle

    public void handle(java.lang.String pathInContext,
                       java.lang.String pathParams,
                       HttpRequest request,
                       HttpResponse response)
                throws HttpException,
                       java.io.IOException

  Handle a request by pre-populating the headers from the configured set of _fields. Settings made here can be overridden by subsequent handling of the request.

  Parameters:
    `pathInContext` - The context path. Ignored.
    `pathParams` - Path parameters such as encoded Session ID. Ignored.
    `request` - The HttpRequest request. Ignored.
    `response` - The HttpResponse response. Updated with new Headers.
    `HttpException`
    `java.io.IOException`

Copyright © 2000 Mortbay Consulting Pty. Ltd. All Rights Reserved.