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:com.fiveamsolutions.nci.commons.web.filter.UsernameFilter.java

/**
 * {@inheritDoc}/*from w ww.ja va  2 s.c  om*/
 */
public void init(FilterConfig filterConfig) {
    caseSensitive = BooleanUtils.toBoolean(filterConfig.getInitParameter("caseSensitive"));
}

From source file:it.attocchi.web.filters.IE7VersionFilter.java

@Override
public void init(FilterConfig config) throws ServletException {
    pathToBeIgnored = config.getInitParameter("pathToBeIgnored");
    userAgentMatch = config.getInitParameter("userAgentMatch");
    xuacompatible = config.getInitParameter("X-UA-Compatible");
}

From source file:org.alfresco.web.awe.filter.WebEditorFilter.java

public void init(FilterConfig config) throws ServletException {
    String contextPathParam = config.getInitParameter(PARAM_CONTEXT_PATH);
    if (contextPathParam != null && contextPathParam.length() > 0) {
        if (contextPathParam.startsWith("/") == false) {
            contextPathParam = "/" + contextPathParam;
        }/*  w  w w  . ja  va2 s .c o  m*/
    }

    // TODO: Read host and port information from config and use
    // on URL is present, for now just use the context path
    // as we are mandating that AWE is on the same server.

    if (contextPathParam != null) {
        this.urlPrefix = contextPathParam;
    } else {
        this.urlPrefix = DEFAULT_CONTEXT_PATH;
    }

    String debug = config.getInitParameter(PARAM_DEBUG);
    if (debug != null && debug.equalsIgnoreCase("true")) {
        this.debugEnabled = Boolean.TRUE;
    }

    if (logger.isDebugEnabled())
        logger.debug("Initialised Web Editor: (urlPrefix: " + this.urlPrefix + ", debug: " + this.debugEnabled
                + ")");
}

From source file:org.sakaiproject.tool.syllabus.FileUploadFilter.java

public void init(FilterConfig config) throws ServletException {
    repositoryPath = config.getInitParameter("org.sakaiproject.tool.syllabus.FileUploadFilter.repositoryPath");

    try {/*from  w w  w.  j a  v  a 2 s . c o m*/
        String paramValue = config
                .getInitParameter("org.sakaiproject.tool.syllabus.FileUploadFilter.sizeThreshold");

        if (paramValue != null)
            sizeThreshold = Integer.parseInt(paramValue);
        paramValue = config.getInitParameter("org.sakaiproject.tool.syllabus.FileUploadFilter.sizeMax");
        if (paramValue != null)
            sizeMax = Long.parseLong(paramValue);
    } catch (NumberFormatException ex) {
        ServletException servletEx = new ServletException();
        servletEx.initCause(ex);
        throw servletEx;
    }
}

From source file:org.apereo.portal.spring.security.RemoteUserSettingFilter.java

@Override
public void init(FilterConfig filterConfig) throws ServletException {
    final String remoteUserFileName = filterConfig.getInitParameter("remoteUserFile");
    this.remoteUserFile = new File(remoteUserFileName);
}

From source file:org.moneta.MonetaPerformanceFilter.java

public void init(FilterConfig filterConfig) throws ServletException {

    String transTimeStr = filterConfig.getInitParameter(PARM_MAX_TRNASACTION_TIME_THRESHOLD_IN_MILLIS);
    if (StringUtils.isNotBlank(transTimeStr)) {
        try {/* ww  w  .  ja v a  2 s  .c o m*/
            transactionTimeThreshold = Long.valueOf(transTimeStr);
        } catch (Exception e) {
            MonetaException ex = (MonetaException) new MonetaException(
                    "Invalid filter parameter - must be numeric", e)
                            .addContextValue("parm name", PARM_MAX_TRNASACTION_TIME_THRESHOLD_IN_MILLIS)
                            .addContextValue("parm value", transTimeStr);
            this.logger.warn(ExceptionUtils.getFullStackTrace(e));
        }
    }
}

From source file:org.seasar.s2click.filter.UrlPatternFilter.java

public void init(FilterConfig config) throws ServletException {
    String exclude = config.getInitParameter(INIT_PARAM_EXCLUDES);
    if (StringUtils.isNotEmpty(exclude)) {
        excludePattern = Pattern.compile(exclude);
    }//from  ww  w.  jav a2s.c  o  m
}

From source file:de.micromata.genome.gwiki.page.impl.i18n.GWikiI18NServletFilter.java

public void init(FilterConfig filterConfig) throws ServletException {

    String moduless = filterConfig.getInitParameter("I18NModules");
    if (StringUtils.isEmpty(moduless) == true) {
        throw new ServletException("Filter needs init parameter I18NModules");
    }/*ww  w .  j  a  va 2s  .  c  o  m*/
    modules = Converter.parseStringTokens(moduless, ", ", false);
    if (modules.isEmpty() == true) {
        throw new ServletException("Filter needs init parameter I18NModules with at least one module");
    }
}

From source file:com.quartercode.femtoweb.impl.FemtoWebFilter.java

@Override
public void init(FilterConfig filterConfig) throws ServletException {

    String actionBasePackage = filterConfig.getInitParameter("actionBasePackage");
    String staticAssetPath = filterConfig.getInitParameter("staticAssetPath");
    String dynamicAssetPath = filterConfig.getInitParameter("dynamicAssetPath");
    String indexUri = filterConfig.getInitParameter("indexUri");

    context = new DefaultContext(actionBasePackage, staticAssetPath, dynamicAssetPath, indexUri);
}

From source file:org.codelabor.system.security.web.filter.SessionValidationFilter.java

@Override
public void init(FilterConfig filterConfig) throws ServletException {
    String tempExpiredURL = filterConfig.getInitParameter("expiredURL");
    if (StringUtils.isNotBlank(tempExpiredURL)) {
        expiredURL = tempExpiredURL;/*from ww  w.  j  a  v a2  s  . co  m*/
    }
    logger.debug("expiredURL: {}", expiredURL);

    super.init(filterConfig);
}