类 DelegatingFilterProxyRegistrationBean
- java.lang.Object
- org.springframework.boot.web.servlet.RegistrationBean
- org.springframework.boot.web.servlet.DynamicRegistrationBean<javax.servlet.FilterRegistration.Dynamic>
- org.springframework.boot.web.servlet.AbstractFilterRegistrationBean<org.springframework.web.filter.DelegatingFilterProxy>
- org.springframework.boot.web.servlet.DelegatingFilterProxyRegistrationBean
- 所有已实现的接口:
org.springframework.beans.factory.Aware
,ServletContextInitializer
,org.springframework.context.ApplicationContextAware
,org.springframework.core.Ordered
public class DelegatingFilterProxyRegistrationBean extends AbstractFilterRegistrationBean<org.springframework.web.filter.DelegatingFilterProxy> implements org.springframework.context.ApplicationContextAware
AServletContextInitializer
to registerDelegatingFilterProxy
s in a Servlet 3.0+ container. Similar to theregistration
features provided byServletContext
but with a Spring Bean friendly design.The bean name of the actual delegate
Filter
should be specified using thetargetBeanName
constructor argument. Unlike theFilterRegistrationBean
, referenced filters are not instantiated early. In fact, if the delegate filter bean is marked@Lazy
it won't be instantiated at all until the filter is called.Registrations can be associated with
URL patterns
and/or servlets (either byname
or via aServletRegistrationBean
s. When no URL pattern or servlets are specified the filter will be associated to '/*'. The targetBeanName will be used as the filter name if not otherwise specified.- 从以下版本开始:
- 1.4.0
- 另请参阅:
ServletContextInitializer
,ServletContext.addFilter(String, Filter)
,FilterRegistrationBean
,DelegatingFilterProxy
字段概要
从类继承的字段 org.springframework.boot.web.servlet.AbstractFilterRegistrationBean
REQUEST_WRAPPER_FILTER_MAX_ORDER
构造器概要
构造器 构造器 说明 DelegatingFilterProxyRegistrationBean(String targetBeanName, ServletRegistrationBean<?>... servletRegistrationBeans)
Create a newDelegatingFilterProxyRegistrationBean
instance to be registered with the specifiedServletRegistrationBean
s.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 org.springframework.web.filter.DelegatingFilterProxy
getFilter()
Return theFilter
to be registered.protected String
getTargetBeanName()
void
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
从类继承的方法 org.springframework.boot.web.servlet.AbstractFilterRegistrationBean
addRegistration, addServletNames, addServletRegistrationBeans, addUrlPatterns, configure, getDescription, getServletNames, getServletRegistrationBeans, getUrlPatterns, isMatchAfter, setDispatcherTypes, setDispatcherTypes, setMatchAfter, setServletNames, setServletRegistrationBeans, setUrlPatterns, toString
从类继承的方法 org.springframework.boot.web.servlet.DynamicRegistrationBean
addInitParameter, getInitParameters, getOrDeduceName, isAsyncSupported, register, setAsyncSupported, setInitParameters, setName
从类继承的方法 org.springframework.boot.web.servlet.RegistrationBean
getOrder, isEnabled, onStartup, setEnabled, setOrder
构造器详细资料
DelegatingFilterProxyRegistrationBean
public DelegatingFilterProxyRegistrationBean(String targetBeanName, ServletRegistrationBean<?>... servletRegistrationBeans)
Create a newDelegatingFilterProxyRegistrationBean
instance to be registered with the specifiedServletRegistrationBean
s.- 参数:
targetBeanName
- name of the target filter bean to look up in the Spring application context (must not benull
).servletRegistrationBeans
- associateServletRegistrationBean
s
方法详细资料
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
- 指定者:
setApplicationContext
在接口中org.springframework.context.ApplicationContextAware
- 抛出:
org.springframework.beans.BeansException
getTargetBeanName
protected String getTargetBeanName()
getFilter
public org.springframework.web.filter.DelegatingFilterProxy getFilter()
从类复制的说明:AbstractFilterRegistrationBean
Return theFilter
to be registered.- 指定者:
getFilter
在类中AbstractFilterRegistrationBean<org.springframework.web.filter.DelegatingFilterProxy>
- 返回:
- the filter