Example usage for javax.servlet FilterConfig getServletContext

List of usage examples for javax.servlet FilterConfig getServletContext

Introduction

In this page you can find the example usage for javax.servlet FilterConfig getServletContext.

Prototype

public ServletContext getServletContext();

Source Link

Document

Returns a reference to the ServletContext in which the caller is executing.

Usage

From source file:gov.nih.nci.cabig.ctms.web.filters.ContextRetainingFilterAdapterTest.java

private void expectRetainServletContext() throws ServletException {
    FilterConfig config = createMock(FilterConfig.class);
    expect(config.getServletContext()).andReturn(servletContext);
    replay(config);/*  www.ja v  a 2 s .co  m*/

    adapter.init(config);
    verify(config);
}

From source file:org.tobarsegais.webapp.RedirectFilter.java

public void init(FilterConfig filterConfig) throws ServletException {
    domain = filterConfig.getServletContext().getInitParameter(RedirectFilter.class.getName() + ".domain");
}

From source file:org.ujorm.orm.support.OpenSessionInViewFilter.java

@Override
public void init(FilterConfig filterConfig) throws ServletException {
    ServletContext sc = filterConfig.getServletContext();
    WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(sc);
    ujoSessionFactoryFilter = (UjoSessionFactoryFilter) wac.getBean("ujoSessionFactory");
}

From source file:org.dspace.solr.filters.LocalHostRestrictionFilter.java

/**
 *
 *///from   w  ww .j a va  2  s  . c  o m
public void init(FilterConfig arg0) throws ServletException {
    String restrict = arg0.getServletContext().getInitParameter("LocalHostRestrictionFilter.localhost");
    if ("false".equalsIgnoreCase(restrict)) {
        enabled = false;
    }

}

From source file:org.esigate.servlet.ProxyFilter.java

@Override
public void init(FilterConfig filterConfig) {
    requestFactory = new RequestFactory(filterConfig.getServletContext());
    // Force esigate configuration parsing to trigger errors right away (if
    // any) and prevent delay on first call.
    DriverFactory.ensureConfigured();// w ww.ja va2 s .c o  m
}

From source file:org.apache.roller.weblogger.ui.core.filters.BootstrapFilter.java

public void init(FilterConfig filterConfig) throws ServletException {
    context = filterConfig.getServletContext();
}

From source file:ca.simplegames.micro.MicroFilter.java

@Override
public Object init(Object config) throws Exception {
    FilterConfig filterConfig = (FilterConfig) config;
    ServletContext servletContext = filterConfig.getServletContext();

    micro = new Micro(servletContext.getRealPath("/"), servletContext,
            StringUtils.defaultString(((FilterConfig) config).getInitParameter("userClassPaths")));

    return this;
}

From source file:de.itsvs.cwtrpc.controller.UnexpectedErrorFilter.java

public void init(FilterConfig config) throws ServletException {
    setServletContext(config.getServletContext());
}

From source file:com.envision.envservice.filter.CertificateFilter.java

@Override
public void init(FilterConfig filterConfig) throws ServletException {
    servletContext = filterConfig.getServletContext();
}

From source file:net.wastl.webmail.config.ContextPathValidator.java

public void init(FilterConfig filterConfig) throws ServletException {
    contextPath = (String) filterConfig.getServletContext().getAttribute("app.contextpath");
    if (contextPath == null) {
        log.fatal("'app.contextpath' attr missing from the app context");
        throw new ServletException("'app.contextpath' attr missing from the app context");
    }/*from   w w  w.  j av  a2s. c o m*/
}