Example usage for javax.servlet ServletConfig getInitParameter

List of usage examples for javax.servlet ServletConfig getInitParameter

Introduction

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

Prototype

public String getInitParameter(String name);

Source Link

Document

Gets the value of the initialization parameter with the given name.

Usage

From source file:de.betterform.agent.web.servlet.XSLTServlet.java

@Override
public void init(ServletConfig config) throws ServletException {
    super.init(config);
    this.editorHome = config.getInitParameter("editorHome");
    this.xslFile = config.getInitParameter("xsltFile");

}

From source file:net.unicon.academus.apps.sso.SsoCallbackServlet.java

public void init(ServletConfig config) throws ServletException {
    super.init(config);
    unauthenticatedRedirectUrl = config.getInitParameter("unauthenticatedRedirectUrl");
}

From source file:org.webguitoolkit.ui.http.resourceprocessor.JSResourceProcessor.java

public void init(ServletConfig config) {

    String bundleScript = config.getInitParameter("bundle-scripts");
    if (StringUtils.isNotEmpty(bundleScript))
        isBundleScripts = bundleScript.equals("true");

    String staticScript = config.getInitParameter("static-script");
    if (StringUtils.isNotEmpty(staticScript))
        isStatic = staticScript.equals("true");

    if (!isStatic) { // static
        WGT_BASE_FILES = getDependendFiles("wgt.controller.base.js", new ArrayList<String>());
    } else {//from w  w w  . j a  va  2  s . co  m
        List<String> files = getDependendFiles("wgt.controller.glossbutton.js", new ArrayList<String>());
        files.addAll(getDependendFiles("wgt.controller.list.js", files));
        files.addAll(getDependendFiles("wgt.controller.menu.js", files));
        files.addAll(getDependendFiles("wgt.controller.dragdrop.js", files));
        files.addAll(getDependendFiles("wgt.controller.multiselect.js", files));
        files.addAll(getDependendFiles("wgt.controller.select.js", files));
        files.addAll(getDependendFiles("wgt.controller.tabstrip.js", files));
        files.addAll(getDependendFiles("wgt.controller.tree.js", files));
        files.addAll(getDependendFiles("wgt.controller.textsuggest.js", files));
        WGT_BASE_FILES = files;
    }
}

From source file:br.bireme.prvtrm.PreviousTermServlet.java

/**
 * INDEX_DIR diretorio contendo o indice Lucene
 * MAX_TERMS numero maximo de termos a serem retornados
 * DOC_FIELDS nomes dos campos cujos termos serao retornados 
 * (separados por ',' ';' ou '-' )/*from  www  .j  a  v  a  2 s. c  o m*/
 * @param servletConfig
 * @throws ServletException 
 */
@Override
public void init(final ServletConfig servletConfig) throws ServletException {
    final String sdir = servletConfig.getInitParameter("INDEX_DIR");
    if (sdir == null) {
        throw new ServletException("missing index directory (INDEX_DIR) " + "parameter.");
    }
    final String maxTerms = servletConfig.getInitParameter("MAX_TERMS");
    if (maxTerms == null) {
        throw new ServletException("missing maximum number of returned " + "terms (MAX_TERMS) parameter.");
    }
    final String fields = servletConfig.getInitParameter("DOC_FIELDS");
    if (fields == null) {
        throw new ServletException("missing document fields (DOC_FIELDS) " + "parameter.");
    }

    try {
        previous = new PreviousTerm(new File(sdir), Arrays.asList(fields.split("[,;\\-]")),
                Integer.parseInt(maxTerms));
    } catch (Exception ex) {
        throw new ServletException(ex);
    }
}

From source file:org.infoscoop.web.AuthenticationServlet.java

public void init(ServletConfig conf) throws ServletException {
    String denyEmptyPassword = conf.getInitParameter("denyEmptyPassword");
    if (denyEmptyPassword != null) {
        isDenyEmptyPassword = Boolean.valueOf(denyEmptyPassword).booleanValue();
    }//from ww  w . j  a v  a2 s  .c  o m
    String logoutUrlParam = conf.getInitParameter("logoutUrl");
    if (logoutUrlParam != null && !"".equals(logoutUrlParam.trim())) {
        logoutUrl = logoutUrlParam;
    }
}

From source file:org.uberfire.ext.plugin.backend.PluginMediaServlet.java

@Override
public void init(final ServletConfig config) throws ServletException {
    final String pattern = config.getInitParameter("url-pattern");
    if (pattern != null && !pattern.trim().isEmpty()) {
        if (pattern.endsWith("/")) {
            this.pattern = pattern;
        } else {/* w w w .j av a2 s. c  om*/
            this.pattern = pattern + "/";
        }
        if (this.pattern.startsWith("/")) {
            mediaServletURI.setURI(this.pattern.substring(1));
        } else {
            mediaServletURI.setURI(this.pattern);
        }
    }
    try {
        fileSystem = ioService.newFileSystem(URI.create("default://plugins"), new HashMap<String, Object>() {
            {
                put("init", Boolean.TRUE);
                put("internal", Boolean.TRUE);
            }
        });
    } catch (final FileSystemAlreadyExistsException e) {
        fileSystem = ioService.getFileSystem(URI.create("default://plugins"));
    }
    this.root = fileSystem.getRootDirectories().iterator().next();
}

From source file:net.ymate.platform.mvc.web.support.DispatchHelper.java

/**
 * //w  w  w .  j a v  a 2s  .c o m
 *
 * @param config
 */
public DispatchHelper(ServletConfig config) {
    prefix = StringUtils.defaultIfEmpty(config.getInitParameter("prefix"), "");
    methodParam = StringUtils.defaultIfEmpty(config.getInitParameter("methodParam"), DEFAULT_METHOD_PARAM);
    baseViewFilePath = RuntimeUtils.getRootPath()
            + StringUtils.substringAfter(TemplateHelper.getRootViewPath(), "/WEB-INF/");
}

From source file:com.sonicle.webtop.core.app.JaxRsServiceApplication.java

private void configureLegacyApiEndpoints(WebTopApp wta, ServletConfig servletConfig) {
    ServiceManager svcMgr = wta.getServiceManager();

    String serviceId = servletConfig.getInitParameter(RestApi.INIT_PARAM_WEBTOP_SERVICE_ID);
    if (StringUtils.isBlank(serviceId))
        throw new WTRuntimeException(
                "Invalid servlet init parameter [" + RestApi.INIT_PARAM_WEBTOP_SERVICE_ID + "]");

    ServiceDescriptor desc = svcMgr.getDescriptor(serviceId);
    if (desc == null)
        throw new WTRuntimeException("Service descriptor not found [{0}]", serviceId);

    if (desc.hasRestApiEndpoints()) {
        // Take only the first. We do not support many endpoints anymore!!!
        ServiceDescriptor.ApiEndpointClass endpointClass = desc.getRestApiEndpoints().get(0);
        logger.debug("[{}] Registering JaxRs resource (legacy) [{}] -> [{}]", servletConfig.getServletName(),
                endpointClass.toString(), "/");
        registerResources(Resource.builder(endpointClass.clazz).path("/").build());
    }/*from   ww w. ja v a  2 s  .c o  m*/
}

From source file:com.github.matthesrieke.jprox.JProxViaParameterServlet.java

@Override
public void init(ServletConfig config) throws ServletException {
    super.init(config);

    if (config != null) {
        String parameterKey = config.getInitParameter("parameterKey");
        if (parameterKey != null) {
            this.parameterKey = parameterKey;
        }//  w w w.j  av a  2  s  . co m
    }

}

From source file:be.fedict.eid.idp.sp.protocol.ws_federation.AuthenticationResponseServlet.java

/**
 * {@inheritDoc}//from w  w  w .j  a va 2s . co  m
 */
@Override
public void init(ServletConfig config) throws ServletException {

    String requiresResponseSignatureString = config.getInitParameter(REQUIRES_RESPONSE_SIGNATURE_INIT_PARAM);
    if (null != requiresResponseSignatureString) {
        requiresResponseSignature = Boolean.valueOf(requiresResponseSignatureString);
    }

    this.responseSessionAttribute = getRequiredInitParameter(RESPONSE_SESSION_ATTRIBUTE_INIT_PARAM, config);
    this.redirectPage = getRequiredInitParameter(REDIRECT_PAGE_INIT_PARAM, config);

    this.errorPage = config.getInitParameter(ERROR_PAGE_INIT_PARAM);
    this.errorMessageSessionAttribute = config.getInitParameter(ERROR_MESSAGE_SESSION_ATTRIBUTE_INIT_PARAM);

    this.serviceLocator = new ServiceLocator<AuthenticationResponseService>(RESPONSE_SERVICE_INIT_PARAM,
            config);
}