Example usage for javax.servlet FilterConfig getInitParameter

List of usage examples for javax.servlet FilterConfig getInitParameter

Introduction

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

Prototype

public String getInitParameter(String name);

Source Link

Document

Returns a String containing the value of the named initialization parameter, or null if the initialization parameter does not exist.

Usage

From source file:AIR.Common.Web.Session.HttpRequestLoggerInitializerFilter.java

@Override
public void init(FilterConfig filterConfig) throws ServletException {
    prefix = filterConfig.getInitParameter("prefix");
    String strLogRequestBodies = filterConfig.getInitParameter("LogRequestBodies");
    logRequestBodies = (strLogRequestBodies != null) && (!"false".equalsIgnoreCase(strLogRequestBodies));
    MDC.put(PROGMAN_LOCATOR, System.getProperty(PROGMAN_LOCATOR));
}

From source file:org.apache.tapestry.RedirectFilter.java

public void init(FilterConfig config) throws ServletException {
    _redirectPath = config.getInitParameter(REDIRECT_PATH_PARAM);

    if (Tapestry.isBlank(_redirectPath))
        _redirectPath = "/app";

    if (LOG.isDebugEnabled())
        LOG.debug(Tapestry.format("RedirectServlet.redirect-path", _redirectPath));
}

From source file:com.easyjf.web.security.acegi.EasyJWebFilterToBeanProxy.java

@Override
protected ApplicationContext getContext(FilterConfig filterConfig) {

    String configFile = filterConfig.getInitParameter(Globals.CONTAINER_CONFIG_LOCATION);
    if (configFile == null || configFile.trim().length() == 0) {
        throw new IllegalArgumentException(Globals.CONTAINER_CONFIG_LOCATION + " can't be null !");
    }/*from   w w w .  j av  a  2 s  .c  o  m*/

    //-------------------- ContainerSingletonContainerLoader ---------------------
    // Document doc = null;
    // try {
    // doc = new SAXReader().read(SingletonContainerLoader.class.getResourceAsStream(configFile));
    // } catch (DocumentException e) {
    // throw new IllegalArgumentException(configFile + "is not a valid config file !");
    // }
    //
    // DefaultContainer container = new DefaultContainer();
    // container.registerBeanDefinitions(BeanConfigReader.parseBeansFromDocument(doc));
    // container.refresh();
    //--------------------------------------------------------------------------------------------- 

    Container container = SingletonContainerLoader.getInstance(configFile);

    SpringContainer springContainer = (SpringContainer) container
            .getBean(Globals.SPRING_INTEGERATION_CONTAINER);
    BeanFactory factory = springContainer.getBeanFactory();
    if (factory instanceof ApplicationContext)
        return (ApplicationContext) factory;
    else
        return null;
}

From source file:com.leixl.easyframework.web.filter.VcaptchaFilter.java

private void initIncludeURIs(FilterConfig config) {
    String includeVal = config.getInitParameter(INCLUDE_URIS);
    if (StringUtils.isNotBlank(includeVal)) {
        includeURIs = includeVal.split(",");
    }/*from  w w  w .  j av  a  2s  .c o m*/
}

From source file:alpine.filters.FqdnForwardFilter.java

/**
 * Initialize "host" parameter from web.xml.
 *
 * @param filterConfig A filter configuration object used by a servlet container
 *                     to pass information to a filter during initialization.
 *///from   ww  w  . j a  v a 2  s  .  co m
public void init(final FilterConfig filterConfig) {
    final String host = filterConfig.getInitParameter("host");
    if (StringUtils.isNotBlank(host)) {
        this.host = host;
    }
}

From source file:org.pentaho.platform.web.http.filters.CheckRefererFilter.java

public void init(FilterConfig filterConfig) throws ServletException {
    String pfx = filterConfig.getInitParameter("refererPrefix"); //$NON-NLS-1$
    String redirect = filterConfig.getInitParameter("redirectTo"); //$NON-NLS-1$
    if (!(StringUtils.isBlank(pfx))) {
        this.setRefererPrefix(pfx);
    }//w ww.  j a v  a  2 s.  c  o m
    if (!(StringUtils.isBlank(redirect))) {
        this.setRedirectTo(redirect);
    }
    if (!checked) {
        try {
            afterPropertiesSet();
        } catch (Exception e) {
            throw new ServletException(e);
        }
    }
}

From source file:org.impalaframework.web.integration.BaseModuleProxyFilter.java

protected RequestModuleMapper newRequestModuleMapper(FilterConfig filterConfig) {
    final String requestModuleMapperClass = filterConfig
            .getInitParameter(WebConstants.REQUEST_MODULE_MAPPER_CLASS_NAME);
    return ModuleProxyUtils.newRequestModuleMapper(requestModuleMapperClass);
}

From source file:org.sonar.server.ui.SonarRackFilter.java

@Override
public void init(FilterConfig config) throws ServletException {
    super.init(config);
    String[] exclusionsStr = StringUtils.split(config.getInitParameter("exclusions"), ',');
    exclusions = new HashSet<String>(Arrays.asList(exclusionsStr));
}

From source file:edu.sdsc.scigraph.services.auth.BasicAuthFilter.java

@Override
public void init(FilterConfig filterConfig) throws ServletException {
    keyParam = filterConfig.getInitParameter(KEY_REQUEST_PARAM);
    if (!isNullOrEmpty(filterConfig.getInitParameter(DEFAULT_API_KEY))) {
        defaultApiKey = Optional.of(filterConfig.getInitParameter(DEFAULT_API_KEY));
    }/*from  w ww. j  a  v a 2  s. c  o  m*/
}

From source file:com.easyshop.common.web.filter.SetCommonDataFilter.java

public void init(FilterConfig filterConfig) throws ServletException {
    webBase = filterConfig.getInitParameter(Constants.WEB_BASE);

    String currentPageParamName = filterConfig.getInitParameter(Constants.CURRENT_PAGE_KEY);
    if (StringUtils.isNotBlank(currentPageParamName)) {
        currentPageParamKey = currentPageParamName;
    }/*  w ww  .j a  va2s  .c o m*/

    String pageSizeParamName = filterConfig.getInitParameter(Constants.PAGE_SIZE_KEY);
    if (StringUtils.isNotBlank(pageSizeParamName)) {
        pageSizeParamKey = pageSizeParamName;
    }
}