Package org.springframework.security.web.header.writers

# Class CompositeHeaderWriter

java.lang.Object
org.springframework.security.web.header.writers.CompositeHeaderWriter

All Implemented Interfaces:
  `HeaderWriter`

public class CompositeHeaderWriter extends Object implements HeaderWriter
A `HeaderWriter` that delegates to several other `HeaderWriter`s.

Since:
  5.2

## Constructor Summary

Constructors
Constructor
Description
`CompositeHeaderWriter(List<HeaderWriter> headerWriters)`
Creates a new instance.

## Method Summary

Modifier and Type
Method
Description
`void`
`writeHeaders(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)`
Create a `Header` instance.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### CompositeHeaderWriter

public CompositeHeaderWriter(List<HeaderWriter> headerWriters)
Creates a new instance.

Parameters:
  `headerWriters` - the `HeaderWriter` instances to write out headers to the `HttpServletResponse`.

## Method Details

### writeHeaders

public void writeHeaders(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
Description copied from interface: `HeaderWriter`
Create a `Header` instance.

Specified by:
  `writeHeaders` in interface `HeaderWriter`
Parameters:
  `request` - the request
  `response` - the response