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.guiceside.web.dispatcher.GuiceSideFilter.java

public void init(FilterConfig filterConfig) throws ServletException {
    this.filterConfig = filterConfig;
    encoding = filterConfig.getInitParameter("encoding");
}

From source file:org.jasig.cas.client.util.ErrorRedirectFilter.java

public void init(final FilterConfig filterConfig) throws ServletException {
    this.defaultErrorRedirectPage = filterConfig.getInitParameter("defaultErrorRedirectPage");

    final Enumeration enumeration = filterConfig.getInitParameterNames();

    while (enumeration.hasMoreElements()) {
        final String className = (String) enumeration.nextElement();
        try {//w  ww . j a va  2s.c o m
            if (!className.equals("defaultErrorRedirectPage")) {
                this.errors.add(new ErrorHolder(className, filterConfig.getInitParameter(className)));
            }
        } catch (final ClassNotFoundException e) {
            log.warn("Class [" + className + "] cannot be found in ClassLoader.  Ignoring.");
        }
    }
}

From source file:com.meltmedia.cadmium.servlets.MaintenanceFilter.java

@Override
public void init(FilterConfig config) throws ServletException {
    if (config.getInitParameter("ignorePrefix") != null) {
        ignorePath = config.getInitParameter("ignorePrefix");
    }/* w  w w  .  jav a2 s  .  c o  m*/
    config.getServletContext().setAttribute(this.getClass().getName(), this);
    ((MaintSiteDownService) siteDown).setMaintenanceFilter(this);
}

From source file:org.codelabor.system.web.filter.EncodingFilter.java

@Override
public void init(FilterConfig filterConfig) throws ServletException {
    super.init(filterConfig);
    String tempEncoding = filterConfig.getInitParameter("encoding");
    if (!StringUtils.isEmpty(tempEncoding)) {
        encoding = tempEncoding;/*from  ww  w .java  2 s.c  o  m*/
    }
}

From source file:com.amalto.core.servlet.TransactionsGuardFilter.java

@Override
public void init(FilterConfig filterConfig) throws ServletException {
    throwExceptions.put(Phase.BEFORE,/* w  ww.j ava 2 s.  c om*/
            Boolean.parseBoolean(filterConfig.getInitParameter(Phase.BEFORE.getFilterConfig())));
    throwExceptions.put(Phase.AFTER,
            Boolean.parseBoolean(filterConfig.getInitParameter(Phase.AFTER.getFilterConfig())));
}

From source file:org.apache.archiva.redback.integration.filter.authorization.SimpleAuthorizationFilter.java

public void init(FilterConfig filterConfig) throws ServletException {
    super.init(filterConfig);

    permission = filterConfig.getInitParameter("permission");
    resource = filterConfig.getInitParameter("resource");
    accessDeniedLocation = filterConfig.getInitParameter("accessDeniedLocation");

    if (StringUtils.isEmpty(accessDeniedLocation)) {
        throw new ServletException("Missing parameter 'accessDeniedLocation' from "
                + SimpleAuthorizationFilter.class.getName() + " configuration.");
    }/*from w  w w  . j  a  va 2 s . c o m*/
}

From source file:gov.nih.nci.cabig.caaers.web.OpenSessionInViewInterceptorFilter.java

public void init(FilterConfig filterConfig) throws ServletException {
    super.init(filterConfig);
    setInterceptorBeanName(filterConfig.getInitParameter("interceptorBeanName"));
}

From source file:org.apache.myfaces.component.html.util.MultipartFilter.java

public void init(FilterConfig filterConfig) {
    uploadMaxFileSize = resolveSize(filterConfig.getInitParameter("uploadMaxFileSize"), uploadMaxFileSize);
    String param = filterConfig.getInitParameter("uploadMaxSize");
    if (param != null) {
        uploadMaxSize = resolveSize(param, uploadMaxSize);
    } else {// www.j a v a2  s.c  o  m
        //If not set, default to uploadMaxFileSize
        uploadMaxSize = resolveSize(param, uploadMaxFileSize);
    }
    uploadThresholdSize = resolveSize(filterConfig.getInitParameter("uploadThresholdSize"),
            uploadThresholdSize);
    uploadRepositoryPath = filterConfig.getInitParameter("uploadRepositoryPath");
    cacheFileSizeErrors = getBooleanValue(filterConfig.getInitParameter("cacheFileSizeErrors"), false);
}

From source file:org.nuxeo.ecm.webengine.jaxrs.login.AuthenticationFilter.java

@Override
public void init(FilterConfig filterConfig) throws ServletException {
    String v = filterConfig.getInitParameter("securityDomain");
    if (v != null) {
        domain = v;/*from ww  w  .j ava2 s.c  om*/
    }
    v = filterConfig.getInitParameter("realmName");
    if (v != null) {
        realmName = v;
    }
}

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

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

    try {// w  w w . jav a2  s  .c  o  m
        String paramValue = config
                .getInitParameter("org.sakaiproject.tool.messageforums.FileUploadFilter.sizeThreshold");

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