@Override public void removeAttribute(String name, int scope) { switch(scope) { case PAGE_SCOPE: { environment.getGlobalNamespace().remove(name); break; } case REQUEST_SCOPE: { getRequest().removeAttribute(name); break; } case SESSION_SCOPE: { HttpSession session = getSession(false); if (session != null) { session.removeAttribute(name); } break; } case APPLICATION_SCOPE: { getServletContext().removeAttribute(name); break; } default: { throw new IllegalArgumentException("Invalid scope: " + scope); } } }
@Override public TemplateModel get(String key) throws TemplateModelException { if ("currentNamespace".equals(key)) { return ((Environment) configurable).getCurrentNamespace(); } if ("dataModel".equals(key)) { return ((Environment) configurable).getDataModel(); } if ("globalNamespace".equals(key)) { return ((Environment) configurable).getGlobalNamespace(); } if ("knownVariables".equals(key)) { return knownVariables; } if ("mainNamespace".equals(key)) { return ((Environment) configurable).getMainNamespace(); } if ("template".equals(key)) { try { return (TemplateModel) getCachedWrapperFor(((Environment) configurable).getTemplate()); } catch (RemoteException e) { throw new TemplateModelException(e); } } return super.get(key); } }
@Override public Enumeration getAttributeNamesInScope(int scope) { switch(scope) { case PAGE_SCOPE: { try { return new TemplateHashModelExEnumeration(environment.getGlobalNamespace()); } catch (TemplateModelException e) { throw new UndeclaredThrowableException(e); } } case REQUEST_SCOPE: { return getRequest().getAttributeNames(); } case SESSION_SCOPE: { HttpSession session = getSession(false); if (session != null) { return session.getAttributeNames(); } return Collections.enumeration(Collections.EMPTY_SET); } case APPLICATION_SCOPE: { return getServletContext().getAttributeNames(); } default: { throw new IllegalArgumentException("Invalid scope " + scope); } } }
case PAGE_SCOPE: { try { final TemplateModel tm = environment.getGlobalNamespace().get(name); if (incompatibleImprovements >= _TemplateAPI.VERSION_INT_2_3_22 && unwrapper != null) { return unwrapper.unwrap(tm);
break; case GLOBAL: namespace = env.getGlobalNamespace(); break; case NAMESPACE:
@Override public void removeAttribute(String name, int scope) { switch(scope) { case PAGE_SCOPE: { environment.getGlobalNamespace().remove(name); break; } case REQUEST_SCOPE: { getRequest().removeAttribute(name); break; } case SESSION_SCOPE: { HttpSession session = getSession(false); if (session != null) { session.removeAttribute(name); } break; } case APPLICATION_SCOPE: { getServletContext().removeAttribute(name); break; } default: { throw new IllegalArgumentException("Invalid scope: " + scope); } } }
@Override public void removeAttribute(String name, int scope) { switch(scope) { case PAGE_SCOPE: { environment.getGlobalNamespace().remove(name); break; } case REQUEST_SCOPE: { getRequest().removeAttribute(name); break; } case SESSION_SCOPE: { HttpSession session = getSession(false); if (session != null) { session.removeAttribute(name); } break; } case APPLICATION_SCOPE: { getServletContext().removeAttribute(name); break; } default: { throw new IllegalArgumentException("Invalid scope: " + scope); } } }
public void removeAttribute(String name, int scope) { switch(scope) { case PAGE_SCOPE: { environment.getGlobalNamespace().remove(name); break; } case REQUEST_SCOPE: { getRequest().removeAttribute(name); break; } case SESSION_SCOPE: { HttpSession session = getSession(false); if(session != null) { session.removeAttribute(name); } break; } case APPLICATION_SCOPE: { getServletContext().removeAttribute(name); break; } default: { throw new IllegalArgumentException("Invalid scope: " + scope); } } }
@Override public TemplateModel get(String key) throws TemplateModelException { if ("currentNamespace".equals(key)) { return ((Environment) configurable).getCurrentNamespace(); } if ("dataModel".equals(key)) { return ((Environment) configurable).getDataModel(); } if ("globalNamespace".equals(key)) { return ((Environment) configurable).getGlobalNamespace(); } if ("knownVariables".equals(key)) { return knownVariables; } if ("mainNamespace".equals(key)) { return ((Environment) configurable).getMainNamespace(); } if ("template".equals(key)) { try { return (TemplateModel) getCachedWrapperFor(((Environment) configurable).getTemplate()); } catch (RemoteException e) { throw new TemplateModelException(e); } } return super.get(key); } }
@Override public TemplateModel get(String key) throws TemplateModelException { if ("currentNamespace".equals(key)) { return ((Environment) configurable).getCurrentNamespace(); } if ("dataModel".equals(key)) { return ((Environment) configurable).getDataModel(); } if ("globalNamespace".equals(key)) { return ((Environment) configurable).getGlobalNamespace(); } if ("knownVariables".equals(key)) { return knownVariables; } if ("mainNamespace".equals(key)) { return ((Environment) configurable).getMainNamespace(); } if ("template".equals(key)) { try { return (TemplateModel) getCachedWrapperFor(((Environment) configurable).getTemplate()); } catch (RemoteException e) { throw new TemplateModelException(e); } } return super.get(key); } }
return ((Environment)configurable).getGlobalNamespace();
@Override public Enumeration getAttributeNamesInScope(int scope) { switch(scope) { case PAGE_SCOPE: { try { return new TemplateHashModelExEnumeration(environment.getGlobalNamespace()); } catch (TemplateModelException e) { throw new UndeclaredThrowableException(e); } } case REQUEST_SCOPE: { return getRequest().getAttributeNames(); } case SESSION_SCOPE: { HttpSession session = getSession(false); if (session != null) { return session.getAttributeNames(); } return Collections.enumeration(Collections.EMPTY_SET); } case APPLICATION_SCOPE: { return getServletContext().getAttributeNames(); } default: { throw new IllegalArgumentException("Invalid scope " + scope); } } }
@Override public Enumeration getAttributeNamesInScope(int scope) { switch(scope) { case PAGE_SCOPE: { try { return new TemplateHashModelExEnumeration(environment.getGlobalNamespace()); } catch (TemplateModelException e) { throw new UndeclaredThrowableException(e); } } case REQUEST_SCOPE: { return getRequest().getAttributeNames(); } case SESSION_SCOPE: { HttpSession session = getSession(false); if (session != null) { return session.getAttributeNames(); } return Collections.enumeration(Collections.EMPTY_SET); } case APPLICATION_SCOPE: { return getServletContext().getAttributeNames(); } default: { throw new IllegalArgumentException("Invalid scope " + scope); } } }
public Enumeration getAttributeNamesInScope(int scope) { switch(scope) { case PAGE_SCOPE: { try { return new TemplateHashModelExEnumeration(environment.getGlobalNamespace()); } catch(TemplateModelException e) { throw new UndeclaredThrowableException(e); } } case REQUEST_SCOPE: { return getRequest().getAttributeNames(); } case SESSION_SCOPE: { HttpSession session = getSession(false); if(session != null) { return session.getAttributeNames(); } return Collections.enumeration(Collections.EMPTY_SET); } case APPLICATION_SCOPE: { return getServletContext().getAttributeNames(); } default: { throw new IllegalArgumentException("Invalid scope " + scope); } } }
case PAGE_SCOPE: { try { TemplateModel m = environment.getGlobalNamespace().get(name); if (m instanceof AdapterTemplateModel) { return ((AdapterTemplateModel) m).getAdaptedObject(OBJECT_CLASS);
case PAGE_SCOPE: { try { final TemplateModel tm = environment.getGlobalNamespace().get(name); if (incompatibleImprovements >= _TemplateAPI.VERSION_INT_2_3_22 && unwrapper != null) { return unwrapper.unwrap(tm);
case PAGE_SCOPE: { try { final TemplateModel tm = environment.getGlobalNamespace().get(name); if (incompatibleImprovements >= _TemplateAPI.VERSION_INT_2_3_22 && unwrapper != null) { return unwrapper.unwrap(tm);
if (namespace == null) { if (scope == GLOBAL) { namespace = env.getGlobalNamespace();
break; case GLOBAL: namespace = env.getGlobalNamespace(); break; case NAMESPACE:
break; case GLOBAL: namespace = env.getGlobalNamespace(); break; case NAMESPACE: