@Override public Enumeration<String> getAttributeNamesInScope(int scope) { switch (scope) { case PAGE_SCOPE: return getAttributeNames(); case REQUEST_SCOPE: return this.request.getAttributeNames(); case SESSION_SCOPE: HttpSession session = this.request.getSession(false); return (session != null ? session.getAttributeNames() : Collections.emptyEnumeration()); case APPLICATION_SCOPE: return this.servletContext.getAttributeNames(); default: throw new IllegalArgumentException("Invalid scope: " + scope); } }
@Override public Enumeration<String> getAttributeNamesInScope(int scope) { switch (scope) { case PAGE_SCOPE: return getAttributeNames(); case REQUEST_SCOPE: return this.request.getAttributeNames(); case SESSION_SCOPE: HttpSession session = this.request.getSession(false); return (session != null ? session.getAttributeNames() : null); case APPLICATION_SCOPE: return this.servletContext.getAttributeNames(); default: throw new IllegalArgumentException("Invalid scope: " + scope); } }
@Override public Enumeration<String> getAttributeNamesInScope(int scope) { switch (scope) { case PAGE_SCOPE: return getAttributeNames(); case REQUEST_SCOPE: return this.request.getAttributeNames(); case SESSION_SCOPE: HttpSession session = this.request.getSession(false); return (session != null ? session.getAttributeNames() : Collections.emptyEnumeration()); case APPLICATION_SCOPE: return this.servletContext.getAttributeNames(); default: throw new IllegalArgumentException("Invalid scope: " + scope); } }