Example usage for javax.servlet ServletContext getAttribute

List of usage examples for javax.servlet ServletContext getAttribute

Introduction

In this page you can find the example usage for javax.servlet ServletContext getAttribute.

Prototype

public Object getAttribute(String name);

Source Link

Document

Returns the servlet container attribute with the given name, or null if there is no attribute by that name.

Usage

From source file:be.fedict.trust.xkms2.ServiceConsumerServletContextListener.java

public static TrustService getTrustService(ServletContext context) {
    return (TrustService) context.getAttribute(TrustService.class.getName());
}

From source file:be.fedict.eid.dss.ws.ServiceConsumerServletContextListener.java

public static DocumentService getDocumentService(ServletContext context) {

    return (DocumentService) context.getAttribute(DocumentService.class.getName());
}

From source file:com.github.mcs.sst.SpringTestHelper.java

/**
 * Injects Spring managed beans using a Web Application Context derived from
 * the ServletContext./*w  w w .jav a 2s .c o  m*/
 *
 * @param bean the object to have beans injected into
 * @param ctx the ServletContext to use to find the Spring ApplicationContext
 */
public static void injectBeans(Object bean, ServletContext ctx) {
    ApplicationContext ac = (ApplicationContext) ctx
            .getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
    injectBeans(bean, ac);
}

From source file:be.fedict.eid.dss.ws.ServiceConsumerServletContextListener.java

public static SignatureVerificationService getSignatureVerificationService(ServletContext context) {
    return (SignatureVerificationService) context.getAttribute(SignatureVerificationService.class.getName());
}

From source file:au.gov.ansto.bragg.nbi.restlet.fileupload.servlet.FileCleanerCleanup.java

/**
 * Returns the instance of {@link FileCleaningTracker}, which is
 * associated with the given {@link ServletContext}.
 *
 * @param pServletContext The servlet context to query
 * @return The contexts tracker/*from   w  w w. j  a v a 2 s  . com*/
 */
public static FileCleaningTracker getFileCleaningTracker(ServletContext pServletContext) {
    return (FileCleaningTracker) pServletContext.getAttribute(FILE_CLEANING_TRACKER_ATTRIBUTE);
}

From source file:com.jsquant.listener.JsquantContextListener.java

public static FileCache getFileCache(ServletContext context) {
    return (FileCache) context.getAttribute(ATTR_FILE_CACHE);
}

From source file:com.jsquant.listener.JsquantContextListener.java

public static HttpClient getHttpClient(ServletContext context) {
    return (HttpClient) context.getAttribute(ATTR_HTTP_CLIENT);
}

From source file:com.khs.sherpa.spring.SpringApplicationContext.java

public static ApplicationContext getApplicationContext(ServletContext context) {
    return (ApplicationContext) context.getAttribute(SHERPA_APPLICATION_CONTEXT_ATTRIBUTE);
}

From source file:org.apache.hadoop.hdfs.qjournal.server.JournalNodeHttpServer.java

public static Configuration getConfFromContext(ServletContext context) {
    return (Configuration) context.getAttribute(JspHelper.CURRENT_CONF);
}

From source file:be.fedict.eid.dss.webapp.StartupServletContextListener.java

/**
 * @param context/*w ww . jav a 2s  .  co m*/
 *            the servlet context
 * @return map of protocol services with context path as key. This map has
 *         been constructed during startup of the eID DSS service.
 */
@SuppressWarnings("unchecked")
public static Map<String, String> getProtocolServiceClassNames(ServletContext context) {
    return (Map<String, String>) context.getAttribute(PROTOCOL_SERVICES_CONTEXT_ATTRIBUTE);
}