@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); } } }
@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); } } }