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:org.beangle.web.filter.CharacterEncodingFilter.java

public void init(FilterConfig filterConfig) throws ServletException {
    String initEncoding = filterConfig.getInitParameter("encoding");
    if (StringUtils.isNotBlank(initEncoding)) {
        this.encoding = initEncoding;
    }/*  w w w.j  a  va2  s.  c o m*/
}

From source file:jrouter.servlet.filter.SpringJRouterFilter.java

@Override
public void init(FilterConfig filterConfig) {
    String useSpring = filterConfig.getInitParameter("useSpringObjectFactory");
    //default true if not set
    if (useSpring != null)
        useSpringObjectFactory = Boolean.parseBoolean(useSpring);
    super.init(filterConfig);
}

From source file:org.carrot2.webapp.RootRedirectFilter.java

public void init(FilterConfig config) throws ServletException {
    this.targetURI = config.getInitParameter(PARAM_TARGET_URI);
    if (StringUtils.isEmpty(targetURI)) {
        throw new ServletException("Missing parameter: " + PARAM_TARGET_URI);
    }// w  ww.j  ava  2  s . c  o  m
}

From source file:io.dropwizard.hystrix.path.tracker.filters.impl.PathTrackerFilter.java

@Override
public void init(FilterConfig filterConfig) throws ServletException {
    key = filterConfig.getInitParameter("commandKey");
    log.info("Setting up PathTrackerFilter, with key:{}" + filterConfig.getInitParameterNames());
}

From source file:de.micromata.genome.logging.web.MultipleReadRequestWrapperFilter.java

@Override
public void init(FilterConfig filterConfig) throws ServletException {
    String param = filterConfig.getInitParameter("maxCachedContentInBytes");
    if (StringUtils.isBlank(param) == false) {
        maxCacheSize = Integer.parseInt(param);
    }/*from w ww. j a  v  a  2  s  . c  o  m*/
}

From source file:com.autentia.intra.filter.UTF8Filter.java

/**
 * Recogemos el tipo de codificacin definido en el web.xml Si no se hubiera
 * especificado ninguno se toma "UTF-8" por defecto
 *//*from  w  ww  .j a  v a 2s  .co  m*/

public void init(FilterConfig cfg) throws ServletException {
    encoding = cfg.getInitParameter("requestEncoding");
    if (encoding == null) {
        encoding = "UTF-8";
    }
    contentType = "text/html; charset=" + encoding;

    log.warn("init - forcing content type to '" + contentType
            + "' for resources filtered by UTF8Filter (see web.xml)");
}

From source file:no.kantega.commons.filter.ParamEncodingFilter.java

public void init(FilterConfig filterConfig) throws ServletException {
    String encoding = filterConfig.getInitParameter(POST_PARAM_ENCODING);
    this.encoding = StringUtils.defaultIfBlank(encoding, "utf-8");

    String GETencoding = filterConfig.getInitParameter(GET_PARAM_ENCODING);
    this.GETencoding = StringUtils.defaultIfBlank(GETencoding, "iso-8859-1");
}

From source file:com.zyeeda.framework.web.CharacterEncodingFilter.java

@Override
public void init(FilterConfig config) throws ServletException {
    encoding = config.getInitParameter("encoding");
    forceEncoding = BooleanUtils.toBoolean(config.getInitParameter("forceEncoding"));
    if (StringUtils.isBlank(encoding)) {
        this.setEncoding("UTF-8");
    }//from   ww  w .  j a v a  2  s. c  om
}

From source file:org.agnitas.web.filter.CharacterEncodingFilter.java

/**
 * initializes this filter/*from  www . j a va 2s .c o  m*/
 */
public void init(FilterConfig config) throws ServletException {
    String encodingParam = config.getInitParameter("encoding");
    if (StringUtils.isNotEmpty(encodingParam)) {
        this.encoding = encodingParam;
    }
}

From source file:com.surfs.storage.web.filter.LoginFilter.java

@Override
public void init(FilterConfig filterConfig) throws ServletException {
    String excludes = filterConfig.getInitParameter("excludes");
    if (StringUtils.isBlank(excludes))
        return;//from   ww w . j a  v a2s  . com
    String[] excludeArray = excludes.split(",");
    excludes_Pattern = new Pattern[excludeArray.length];
    for (int i = 0; i < excludeArray.length; i++) {
        excludes_Pattern[i] = Pattern.compile(excludeArray[i].trim());
    }
}