Class StaticHeadersWriter
- java.lang.Object
-
- org.springframework.security.web.header.writers.StaticHeadersWriter
-
- All Implemented Interfaces:
HeaderWriter
- Direct Known Subclasses:
XContentTypeOptionsHeaderWriter
public class StaticHeadersWriter extends java.lang.Object implements HeaderWriter
HeaderWriter
implementation which writes the sameHeader
instance.- Since:
- 3.2
-
-
Constructor Summary
Constructors Constructor Description StaticHeadersWriter(java.lang.String headerName, java.lang.String... headerValues)
Creates a new instance with a single headerStaticHeadersWriter(java.util.List<Header> headers)
Creates a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
toString()
void
writeHeaders(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Create aHeader
instance.
-
-
-
Constructor Detail
-
StaticHeadersWriter
public StaticHeadersWriter(java.util.List<Header> headers)
Creates a new instance- Parameters:
headers
- theHeader
instances to use
-
StaticHeadersWriter
public StaticHeadersWriter(java.lang.String headerName, java.lang.String... headerValues)
Creates a new instance with a single header- Parameters:
headerName
- the name of the headerheaderValues
- the values for the header
-
-
Method Detail
-
writeHeaders
public void writeHeaders(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Description copied from interface:HeaderWriter
Create aHeader
instance.- Specified by:
writeHeaders
in interfaceHeaderWriter
- Parameters:
request
- the requestresponse
- the response
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-