/** * The default behavior of this method is to return getAttributeNames() * on the wrapped request object. */ public Enumeration getAttributeNames() { return this.request.getAttributeNames(); }
public static String dumpRequestAttributes(ServletRequest request) { StringBuilder sb = new StringBuilder(); Enumeration<?> en = request.getAttributeNames(); while (en.hasMoreElements()) { String name = (String) en.nextElement(); sb.append("[" + name + "]: " + request.getAttribute(name) + '\n'); } return sb.toString(); }
public Set<String> names() { Set<String> list = new HashSet<String>(); synchronized (req) { Enumeration<String> ems = req.getAttributeNames(); while (ems.hasMoreElements()) { String key = ems.nextElement(); if (null == key) continue; Object value = req.getAttribute(key); if (value instanceof ObjectProxy) { list.add(key); } } } return list; } }
public void clear() { synchronized (req) { Enumeration<String> ems = req.getAttributeNames(); List<String> keys = new ArrayList<String>(); while (ems.hasMoreElements()) { String key = ems.nextElement(); if (null == key) continue; Object value = req.getAttribute(key); if (value instanceof ObjectProxy) { keys.add(key); ((ObjectProxy) value).depose(); } } for (String key : keys) { req.removeAttribute(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); } } }
/** * The default behavior of this method is to return getAttributeNames() * on the wrapped request object. */ public Enumeration<String> getAttributeNames() { return this.request.getAttributeNames(); }
/** * The default behavior of this method is to return getAttributeNames() * on the wrapped request object. */ public Enumeration<String> getAttributeNames() { return this.request.getAttributeNames(); }
@SuppressWarnings("unchecked") private Enumeration<String> getAttributeNames() { return context != null ? context.getAttributeNames() : request.getAttributeNames(); }
/** * Keep a snapshot of the request attributes in case of an include, to * be able to restore the original attributes after the include. * * @param inv */ private void saveAttributesBeforeInclude(final Invocation inv) { ServletRequest request = inv.getRequest(); logger.debug("Taking snapshot of request attributes before include"); Map<String, Object> attributesSnapshot = new HashMap<String, Object>(); Enumeration<?> attrNames = request.getAttributeNames(); while (attrNames.hasMoreElements()) { String attrName = (String) attrNames.nextElement(); attributesSnapshot.put(attrName, request.getAttribute(attrName)); } inv.setAttribute("$$paoding-rose.attributesBeforeInclude", attributesSnapshot); }
/** * 取得request作用域的所有属性的keys。 * <p> * 首先取得context中的所有keys,然后取得<code>request.getAttributeNames</code> * 所返回的keys。keys不会重复。 * </p> */ @Override public Enumeration<String> getAttributeNames() { @SuppressWarnings("unchecked") Enumeration<String> attrNames = getRequest().getAttributeNames(); return new AttributeNamesEnumeration(context.keySet(), attrNames); }
/** * 取得request作用域的所有属性的keys。 * <p> * 首先取得context中的所有keys,然后取得<code>request.getAttributeNames</code> * 所返回的keys。keys不会重复。 * </p> */ @Override public Enumeration<String> getAttributeNames() { @SuppressWarnings("unchecked") Enumeration<String> attrNames = getRequest().getAttributeNames(); return new AttributeNamesEnumeration(context.keySet(), attrNames); }
/** * The default behavior of this method is to return getAttributeNames() * on the wrapped request object. */ public Enumeration getAttributeNames() { return this.request.getAttributeNames(); }
/** * The default behavior of this method is to return getAttributeNames() * on the wrapped request object. */ public Enumeration<String> getAttributeNames() { return this.request.getAttributeNames(); }
/** * The default behavior of this method is to return getAttributeNames() * on the wrapped request object. */ public Enumeration<String> getAttributeNames() { return this.request.getAttributeNames(); }
/** * The default behavior of this method is to return getAttributeNames() * on the wrapped request object. */ public Enumeration getAttributeNames() { return this.request.getAttributeNames(); }
/** * The default behavior of this method is to return getAttributeNames() * on the wrapped request object. */ public Enumeration<String> getAttributeNames() { return this.request.getAttributeNames(); }
/** * The default behavior of this method is to return getAttributeNames() * on the wrapped request object. */ public Enumeration getAttributeNames() { return this.request.getAttributeNames(); }
/** * The default behavior of this method is to return getAttributeNames() * on the wrapped request object. */ public Enumeration<String> getAttributeNames() { return this.request.getAttributeNames(); }
public Set<String> keySet() { Set<String> keys = new HashSet<String>(); Enumeration<String> names = request.getAttributeNames(); while ( names.hasMoreElements() ) { keys.add( names.nextElement() ); } return keys; }
public AttributeNamesEnumerator() { int last = -1; parentEnumeration = getRequest().getAttributeNames(); for (int i = specialAttributes.length - 1; i >= 0; i--) { if (getAttribute(specials[i]) != null) { last = i; break; } } this.last = last; }