|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.security.web.context.AbstractSecurityWebApplicationInitializer
public abstract class AbstractSecurityWebApplicationInitializer
Registers the DelegatingFilterProxy
to use the
springSecurityFilterChain before any other registered Filter
. This
class is typically used in addition to a subclass of
AbstractContextLoaderInitializer
.
By default the DelegatingFilterProxy
is registered without support,
but can be enabled by overriding isAsyncSecuritySupported()
and
getSecurityDispatcherTypes()
.
Additional configuration before and after the springSecurityFilterChain can
be added by overriding
#beforeSpringSecurityFilterChain(ServletContext)
and
afterSpringSecurityFilterChain(ServletContext)
.
Subclasses of AbstractDispatcherServletInitializer will register their
filters before any other Filter
. This means that you will typically
want to ensure subclasses of AbstractDispatcherServletInitializer are invoked
first. This can be done by ensuring the Order
or Ordered
of
AbstractDispatcherServletInitializer are sooner than subclasses of
AbstractSecurityWebApplicationInitializer
.
Constructor Summary | |
---|---|
AbstractSecurityWebApplicationInitializer()
|
Method Summary | |
---|---|
protected void |
afterSpringSecurityFilterChain(javax.servlet.ServletContext servletContext)
Invoked after the springSecurityFilterChain is added. |
protected void |
appendFilters(javax.servlet.ServletContext servletContext,
javax.servlet.Filter... filters)
Inserts the provided Filter s after existing Filter s
using default generated names, getSecurityDispatcherTypes() , and
isAsyncSecuritySupported() . |
protected boolean |
enableHttpSessionEventPublisher()
Override this if HttpSessionEventPublisher should be added as a
listener. |
protected String |
getDispatcherWebApplicationContextSuffix()
Return the WebApplicationContext to find the DelegatingFilterProxy
or null to use the parent ApplicationContext . |
protected EnumSet<javax.servlet.DispatcherType> |
getSecurityDispatcherTypes()
Get the DispatcherType for the springSecurityFilterChain. |
protected void |
insertFilters(javax.servlet.ServletContext servletContext,
javax.servlet.Filter... filters)
Inserts the provided Filter s before existing Filter s
using default generated names, getSecurityDispatcherTypes() , and
isAsyncSecuritySupported() . |
protected boolean |
isAsyncSecuritySupported()
Determine if the springSecurityFilterChain should be marked as supporting asynch. |
void |
onStartup(javax.servlet.ServletContext servletContext)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractSecurityWebApplicationInitializer()
Method Detail |
---|
public final void onStartup(javax.servlet.ServletContext servletContext) throws javax.servlet.ServletException
onStartup
in interface WebApplicationInitializer
javax.servlet.ServletException
protected boolean enableHttpSessionEventPublisher()
HttpSessionEventPublisher
should be added as a
listener. This should be true, if session management has specified a
maximum number of sessions.
HttpSessionEventPublisher
, else falseprotected final void insertFilters(javax.servlet.ServletContext servletContext, javax.servlet.Filter... filters)
Filter
s before existing Filter
s
using default generated names, getSecurityDispatcherTypes()
, and
isAsyncSecuritySupported()
.
servletContext
- the ServletContext
to usefilters
- the Filter
s to registerprotected final void appendFilters(javax.servlet.ServletContext servletContext, javax.servlet.Filter... filters)
Filter
s after existing Filter
s
using default generated names, getSecurityDispatcherTypes()
, and
isAsyncSecuritySupported()
.
servletContext
- the ServletContext
to usefilters
- the Filter
s to registerprotected String getDispatcherWebApplicationContextSuffix()
WebApplicationContext
to find the DelegatingFilterProxy
or null to use the parent ApplicationContext
.
For example, if you are using AbstractDispatcherServletInitializer or
AbstractAnnotationConfigDispatcherServletInitializer and using the
provided Servlet name, you can return "dispatcher" from this method to
use the DispatcherServlet's WebApplicationContext
.
WebApplicationContext
or null (default) to use the parent
ApplicationContext
.protected void afterSpringSecurityFilterChain(javax.servlet.ServletContext servletContext)
servletContext
- the ServletContext
protected EnumSet<javax.servlet.DispatcherType> getSecurityDispatcherTypes()
DispatcherType
for the springSecurityFilterChain.
protected boolean isAsyncSecuritySupported()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |