@SuppressWarnings({"UnusedDeclaration"})
    protected void setContextAttribute(String key, Object value) {
        if (value == null) {
            removeContextAttribute(key);
        } else {
            getRequiredServletContext().setAttribute(key, value);
        }
    }
Base implementation for any components that need to access the web application's {@link ServletContext ServletContext}.

@since 0.2
web/src/main/java/org/apache/shiro/web/servlet/ServletContextSupport.java