org.mortbay.http.handler
Class SetResponseHeadersHandler
- HttpHandler, LifeCycle, Serializable
public class SetResponseHeadersHandler
Handler that allows arbitrary HTTP Header values to be set in the response.
$Id: SetResponseHeadersHandler.java,v 1.6 2005/08/13 00:01:26 gregwilkins Exp $ void | handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse response) - Handle a request by pre-populating the headers from the configured
set of _fields.
|
void | setHeaderValue(String name, String value) - Set a header override, every response handled will have this header set.
|
void | setHeaderValues(String name, String[] values) - Set a multivalued header, every response handled will have
this header set with the provided values.
|
handle
public void handle(String pathInContext,
String pathParams,
HttpRequest request,
HttpResponse response)
throws HttpException,
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.
- handle in interface HttpHandler
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.
setHeaderValue
public void setHeaderValue(String name,
String value)
Set a header override, every response handled will have this header set.
name
- The String name of the header.value
- The String value of the header.
setHeaderValues
public void setHeaderValues(String name,
String[] values)
Set a multivalued header, every response handled will have
this header set with the provided values.
name
- The String name of the header.values
- An Array of String values to use as the values for a Header.
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.