Example usage for org.springframework.security.web.context.support SecurityWebApplicationContextUtils findRequiredWebApplicationContext

List of usage examples for org.springframework.security.web.context.support SecurityWebApplicationContextUtils findRequiredWebApplicationContext

Introduction

In this page you can find the example usage for org.springframework.security.web.context.support SecurityWebApplicationContextUtils findRequiredWebApplicationContext.

Prototype

public static WebApplicationContext findRequiredWebApplicationContext(ServletContext servletContext) 

Source Link

Document

Find a unique WebApplicationContext for this web app: either the root web app context (preferred) or a unique WebApplicationContext among the registered ServletContext attributes (typically coming from a single DispatcherServlet in the current web application).

Usage

From source file:org.springframework.security.taglibs.authz.AccessControlListTag.java

/**
 * Allows test cases to override where application context obtained from.
 *
 * @param pageContext so the <code>ServletContext</code> can be accessed as required
 * by Spring's <code>WebApplicationContextUtils</code>
 *
 * @return the Spring application context (never <code>null</code>)
 *///from ww w  . ja  va  2s .  c o m
protected ApplicationContext getContext(PageContext pageContext) {
    ServletContext servletContext = pageContext.getServletContext();

    return SecurityWebApplicationContextUtils.findRequiredWebApplicationContext(servletContext);
}

From source file:org.springframework.security.web.session.HttpSessionEventPublisher.java

ApplicationContext getContext(ServletContext servletContext) {
    return SecurityWebApplicationContextUtils.findRequiredWebApplicationContext(servletContext);
}