Example usage for org.springframework.web.servlet FrameworkServlet getServletContextAttributeName

List of usage examples for org.springframework.web.servlet FrameworkServlet getServletContextAttributeName

Introduction

In this page you can find the example usage for org.springframework.web.servlet FrameworkServlet getServletContextAttributeName.

Prototype

public String getServletContextAttributeName() 

Source Link

Document

Return the ServletContext attribute name for this servlet's WebApplicationContext.

Usage

From source file:org.impalaframework.web.spring.helper.ImpalaServletUtils.java

public static void publishWebApplicationContext(WebApplicationContext wac, FrameworkServlet servlet) {

    String attrName = servlet.getServletContextAttributeName();
    servlet.getServletContext().setAttribute(attrName, wac);

    if (logger.isDebugEnabled()) {
        logger.debug("Published WebApplicationContext of servlet '" + servlet.getServletName()
                + "' as ServletContext attribute with name [" + attrName + "]");
    }//from   w  w  w. j  a va2  s.c o m
}

From source file:org.impalaframework.web.spring.helper.ImpalaServletUtils.java

public static void unpublishWebApplicationContext(FrameworkServlet servlet) {

    String attrName = servlet.getServletContextAttributeName();
    servlet.getServletContext().removeAttribute(attrName);

    if (logger.isDebugEnabled()) {
        logger.debug("Removed WebApplicationContext of servlet '" + servlet.getServletName()
                + "' as ServletContext attribute with name [" + attrName + "]");
    }/*from w ww .  j a v a 2 s  . c  om*/
}