Example usage for javax.servlet.jsp PageContext removeAttribute

List of usage examples for javax.servlet.jsp PageContext removeAttribute

Introduction

In this page you can find the example usage for javax.servlet.jsp PageContext removeAttribute.

Prototype


abstract public void removeAttribute(String name, int scope);

Source Link

Document

Remove the object reference associated with the specified name in the given scope.

Usage

From source file:org.lightadmin.core.view.editor.JspFragmentFieldControl.java

@Override
public void doTag() throws JspException, IOException {
    addAttribute("field", field);
    addAttribute("attributeMetadata", persistentProperty);
    prepare();//www  .  j  a  v a 2  s . com
    PageContext pageContext = (PageContext) getJspContext();
    try {
        pageContext.include(jspPath, true);
    } catch (ServletException e) {
        throw new JspException(e);
    } finally {
        pageContext.removeAttribute("field", REQUEST_SCOPE);
        pageContext.removeAttribute("attributeMetadata", REQUEST_SCOPE);
    }
}

From source file:de.hybris.platform.addonsupport.renderer.impl.DefaultAddOnCMSComponentRenderer.java

protected void unExposeVariables(final PageContext pageContext, @SuppressWarnings("unused") final C component,
        final Map<String, Object> exposedVariables) {
    if (exposedVariables != null) {
        for (final String variableName : exposedVariables.keySet()) {
            pageContext.removeAttribute(variableName, getScopeForVariableName(variableName));
        }/*from ww  w  . jav a  2s. c  om*/
    }
}

From source file:org.apache.tiles.jsp.context.JspUtil.java

/**
 * Configures the container to be used in the application.
 *
 * @param context The page context object to use.
 * @param container The container object to set.
 * @param key The key under which the container will be stored.
 * @since 2.1.2/*from   w  w w.  j av  a 2  s. co m*/
 */
public static void setContainer(PageContext context, TilesContainer container, String key) {
    Log log = LogFactory.getLog(ServletUtil.class);
    if (key == null) {
        key = TilesAccess.CONTAINER_ATTRIBUTE;
    }

    if (container == null) {
        if (log.isInfoEnabled()) {
            log.info("Removing TilesContext for context: " + context.getClass().getName());
        }
        context.removeAttribute(key, PageContext.APPLICATION_SCOPE);
    }
    if (container != null && log.isInfoEnabled()) {
        log.info("Publishing TilesContext for context: " + context.getClass().getName());
    }
    context.setAttribute(key, container, PageContext.APPLICATION_SCOPE);
}