Package org.springframework.security.web.authentication.ui

# Class DefaultResourcesFilter

java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.security.web.authentication.ui.DefaultResourcesFilter

All Implemented Interfaces:
  `jakarta.servlet.Filter`, `org.springframework.beans.factory.Aware`, `org.springframework.beans.factory.BeanNameAware`, `org.springframework.beans.factory.DisposableBean`, `org.springframework.beans.factory.InitializingBean`, `org.springframework.context.EnvironmentAware`, `org.springframework.core.env.EnvironmentCapable`, `org.springframework.web.context.ServletContextAware`

public final class DefaultResourcesFilter extends org.springframework.web.filter.GenericFilterBean
Serve common static assets used in default UIs, such as CSS or Javascript files. For internal use only.

Since:
  6.4

## Field Summary

### Fields inherited from class org.springframework.web.filter.GenericFilterBean

`logger`

## Method Summary

Modifier and Type
Method
Description
`static DefaultResourcesFilter`
`css()`
Create an instance of `DefaultResourcesFilter` serving Spring Security's default CSS stylesheet.
`void`
`doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain filterChain)`
`String`
`toString()`
`static DefaultResourcesFilter`
`webauthn()`
Create an instance of `DefaultResourcesFilter` serving Spring Security's default webauthn javascript.

### Methods inherited from class org.springframework.web.filter.GenericFilterBean

`addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext`

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

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

## Method Details

### doFilter

public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain filterChain) throws jakarta.servlet.ServletException, IOException

Throws:
  `jakarta.servlet.ServletException`
  `IOException`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### css

public static DefaultResourcesFilter css()
Create an instance of `DefaultResourcesFilter` serving Spring Security's default CSS stylesheet.

The created `DefaultResourcesFilter` matches requests `HTTP GET /default-ui.css`, and returns the default stylesheet at `org/springframework/security/default-ui.css` with content-type `text/css;charset=UTF-8`.

Returns:
  -

### webauthn

public static DefaultResourcesFilter webauthn()
Create an instance of `DefaultResourcesFilter` serving Spring Security's default webauthn javascript.

The created `DefaultResourcesFilter` matches requests `HTTP GET /login/webauthn.js`, and returns the default webauthn javascript at `org/springframework/security/spring-security-webauthn.js` with content-type `text/javascript;charset=UTF-8`. This file is generated in the `spring-security-javascript` project.

Returns:
  -