Example usage for org.apache.commons.jxpath.servlet Constants APPLICATION_SCOPE

List of usage examples for org.apache.commons.jxpath.servlet Constants APPLICATION_SCOPE

Introduction

In this page you can find the example usage for org.apache.commons.jxpath.servlet Constants APPLICATION_SCOPE.

Prototype

String APPLICATION_SCOPE

To view the source code for org.apache.commons.jxpath.servlet Constants APPLICATION_SCOPE.

Click Source Link

Document

Variable name for javax.servlet.ServletContext .

Usage

From source file:org.apache.cocoon.jxpath.JXPathCocoonContexts.java

/**
 * Returns a JXPathContext bound to the "application" scope. Caches that context
 * within the servlet context itself./*  w w w .  j  a va  2s .c om*/
 */
public final JXPathContext getApplicationContext(Context envContext) {
    JXPathContext context = (JXPathContext) envContext.getAttribute(Constants.JXPATH_CONTEXT);
    if (context == null) {
        envContext = new ContextProxy(envContext);
        context = factory.newContext(null, envContext);
        context.setVariables(new KeywordVariables(Constants.APPLICATION_SCOPE, envContext));
        envContext.setAttribute(Constants.JXPATH_CONTEXT, context);
    }
    return context;
}