javax.servlet.http.HttpServletRequestWrapper.getAttributeNames()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(227)

本文整理了Java中javax.servlet.http.HttpServletRequestWrapper.getAttributeNames()方法的一些代码示例,展示了HttpServletRequestWrapper.getAttributeNames()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpServletRequestWrapper.getAttributeNames()方法的具体详情如下:
包路径:javax.servlet.http.HttpServletRequestWrapper
类名称:HttpServletRequestWrapper
方法名:getAttributeNames

HttpServletRequestWrapper.getAttributeNames介绍

暂无

代码示例

代码示例来源:origin: cloudfoundry/uaa

  1. @Override
  2. public Enumeration<String> getAttributeNames() {
  3. return super.getAttributeNames();
  4. }

代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel

  1. @Override
  2. public Enumeration<String> getAttributeNames() {
  3. Enumeration<String> superEnumeration = super.getAttributeNames();
  4. if (_attributes.isEmpty()) {
  5. return superEnumeration;
  6. }
  7. Set<String> names = new HashSet<>();
  8. while (superEnumeration.hasMoreElements()) {
  9. names.add(superEnumeration.nextElement());
  10. }
  11. names.addAll(_attributes.keySet());
  12. return Collections.enumeration(names);
  13. }

代码示例来源:origin: paoding-code/paoding-rose

  1. /**
  2. * 返回这个窗口的私有属性名加portal主控请求对象共同属性的属性名
  3. */
  4. @SuppressWarnings("unchecked")
  5. public Enumeration getAttributeNames() {
  6. HashSet<String> keys;
  7. synchronized (mutex) {
  8. keys = new HashSet<String>(window.getAttributes().keySet());
  9. Enumeration<String> names = super.getAttributeNames();
  10. while (names.hasMoreElements()) {
  11. String name = (String) names.nextElement();
  12. if (deleteAttributes == null || !deleteAttributes.contains(name)) {
  13. keys.add(name);
  14. }
  15. }
  16. }
  17. return new Enumerator(keys);
  18. }

代码示例来源:origin: com.atlassian.jira/jira-core

  1. @Override
  2. public Enumeration getAttributeNames()
  3. {
  4. Enumeration attributeNames = super.getAttributeNames();
  5. return attributeNames;
  6. }

代码示例来源:origin: com.github.wuic/wuic-servlet

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public Enumeration<String> getAttributeNames() {
  6. // Synchronized access
  7. synchronized (mutex) {
  8. return super.getAttributeNames();
  9. }
  10. }

代码示例来源:origin: com.bbossgroups.pdp/pdp-cms

  1. public Enumeration<String> getAttributeNames()
  2. {
  3. if(this.attributes == null)
  4. return super.getAttributeNames();
  5. else
  6. {
  7. return attributes.keys();
  8. }
  9. }
  10. public Object getAttribute(String name)

代码示例来源:origin: org.thymeleaf.extras/thymeleaf-extras-tiles2

  1. @Override
  2. @SuppressWarnings("rawtypes")
  3. public Enumeration getAttributeNames() {
  4. final Enumeration attributeNamesEnum = super.getAttributeNames();
  5. final List<String> attributeNames = new ArrayList<String>();
  6. while (attributeNamesEnum.hasMoreElements()) {
  7. attributeNames.add((String)attributeNamesEnum.nextElement());
  8. }
  9. attributeNames.addAll(this.localVariables.keySet());
  10. return Collections.enumeration(attributeNames);
  11. }

代码示例来源:origin: Jasig/uPortal

  1. @Override
  2. public Enumeration getAttributeNames() {
  3. this.checkState();
  4. return super.getAttributeNames();
  5. }

代码示例来源:origin: thymeleaf/thymeleaf-extras-tiles2

  1. @Override
  2. @SuppressWarnings("rawtypes")
  3. public Enumeration getAttributeNames() {
  4. final Enumeration attributeNamesEnum = super.getAttributeNames();
  5. final List<String> attributeNames = new ArrayList<String>();
  6. while (attributeNamesEnum.hasMoreElements()) {
  7. attributeNames.add((String)attributeNamesEnum.nextElement());
  8. }
  9. attributeNames.addAll(this.localVariables.keySet());
  10. return Collections.enumeration(attributeNames);
  11. }

代码示例来源:origin: org.jasig.portal/uPortal-rendering

  1. @Override
  2. public Enumeration getAttributeNames() {
  3. this.checkState();
  4. return super.getAttributeNames();
  5. }

代码示例来源:origin: org.apache.wink/wink-server

  1. @SuppressWarnings("unchecked")
  2. @Override
  3. public Enumeration getAttributeNames() {
  4. return getCorrectRequest().getAttributeNames();
  5. }

代码示例来源:origin: com.bbossgroups.pdp/pdp-cms

  1. private void initAttributes()
  2. {
  3. this.attributes = new Hashtable<String,Object>();
  4. Enumeration<String> names = super.getAttributeNames();
  5. while(names.hasMoreElements())
  6. {
  7. String name = names.nextElement();
  8. this.attributes.put(name, super.getAttribute(name));
  9. }
  10. }

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

  1. public Enumeration getAttributeNames()
  2. {
  3. Set s = new HashSet();
  4. s.addAll(m_attributes.keySet());
  5. for (Enumeration e = super.getAttributeNames(); e.hasMoreElements();)
  6. {
  7. String name = (String) e.nextElement();
  8. s.add(name);
  9. }
  10. return new IteratorEnumeration(s.iterator());
  11. }

代码示例来源:origin: com.stormpath.sdk/stormpath-sdk-servlet

  1. @Override
  2. public Enumeration<String> getAttributeNames() {
  3. final Enumeration<String> enumeration = super.getAttributeNames();
  4. Map<String, ?> config = getConfig();
  5. if (config == null) { //spring environments
  6. config = new HashMap<String, Object>();
  7. }
  8. final Set<String> keys = config.keySet();
  9. final Iterator<String> configIterator = keys.iterator();
  10. return new Enumeration<String>() {
  11. @Override
  12. public boolean hasMoreElements() {
  13. return enumeration.hasMoreElements() || configIterator.hasNext();
  14. }
  15. @Override
  16. public String nextElement() {
  17. if (enumeration.hasMoreElements()) {
  18. return enumeration.nextElement();
  19. }
  20. return configIterator.next();
  21. }
  22. };
  23. }

代码示例来源:origin: stormpath/stormpath-sdk-java

  1. @Override
  2. public Enumeration<String> getAttributeNames() {
  3. final Enumeration<String> enumeration = super.getAttributeNames();
  4. Map<String, ?> config = getConfig();
  5. if (config == null) { //spring environments
  6. config = new HashMap<String, Object>();
  7. }
  8. final Set<String> keys = config.keySet();
  9. final Iterator<String> configIterator = keys.iterator();
  10. return new Enumeration<String>() {
  11. @Override
  12. public boolean hasMoreElements() {
  13. return enumeration.hasMoreElements() || configIterator.hasNext();
  14. }
  15. @Override
  16. public String nextElement() {
  17. if (enumeration.hasMoreElements()) {
  18. return enumeration.nextElement();
  19. }
  20. return configIterator.next();
  21. }
  22. };
  23. }

代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core

  1. public Map<String, Object> getAttributeMap(String referencePath) {
  2. String namespace = getReferenceNamespacePath(referencePath);
  3. String prefix = getFullNamespacePrefix(namespace);
  4. int prefixLen = prefix.length();
  5. Map<String, Object> attributesMap = this.namespaceAttributesMap.get(prefix);
  6. if (attributesMap == null) {
  7. attributesMap = new HashMap<String, Object>();
  8. for (Enumeration attributeNames = super.getAttributeNames(); attributeNames.hasMoreElements(); ) {
  9. String encodedAttributeName = (String) attributeNames.nextElement();
  10. if (encodedAttributeName.startsWith(prefix)) {
  11. String attributeName = encodedAttributeName.substring(prefixLen);
  12. Object attributeValue = super.getAttribute(encodedAttributeName);
  13. attributesMap.put(attributeName, attributeValue);
  14. }
  15. }
  16. this.namespaceAttributesMap.put(prefix, attributesMap);
  17. }
  18. return attributesMap;
  19. }

代码示例来源:origin: org.onehippo.ecm.hst.components/hst-core

  1. public Map<String, Object> getAttributeMap(String referencePath) {
  2. String namespace = getReferenceNamespacePath(referencePath);
  3. String prefix = getFullNamespacePrefix(namespace);
  4. int prefixLen = prefix.length();
  5. Map<String, Object> attributesMap = this.namespaceAttributesMap.get(prefix);
  6. if (attributesMap == null) {
  7. attributesMap = new HashMap<String, Object>();
  8. for (Enumeration attributeNames = super.getAttributeNames(); attributeNames.hasMoreElements(); ) {
  9. String encodedAttributeName = (String) attributeNames.nextElement();
  10. if (encodedAttributeName.startsWith(prefix)) {
  11. String attributeName = encodedAttributeName.substring(prefixLen);
  12. Object attributeValue = super.getAttribute(encodedAttributeName);
  13. attributesMap.put(attributeName, attributeValue);
  14. }
  15. }
  16. this.namespaceAttributesMap.put(prefix, attributesMap);
  17. }
  18. return attributesMap;
  19. }

代码示例来源:origin: org.onehippo.ecm.hst.components/hst-core

  1. @Override
  2. public Enumeration getAttributeNames() {
  3. List servletRequestAttrs = EnumerationUtils.toList(super.getAttributeNames());
  4. Set localRequestAttrs = this.getAttributeMap().keySet();
  5. Collection composite = new CompositeCollection(new Collection [] { servletRequestAttrs, localRequestAttrs });
  6. return Collections.enumeration(composite);
  7. }

代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core

  1. @SuppressWarnings("unchecked")
  2. @Override
  3. public Enumeration getAttributeNames() {
  4. List servletRequestAttrs = EnumerationUtils.toList(super.getAttributeNames());
  5. Set<String> localRequestAttrs = this.getAttributeMap().keySet();
  6. Collection composite = new CompositeCollection(new Collection [] { servletRequestAttrs, localRequestAttrs });
  7. return Collections.enumeration(composite);
  8. }

代码示例来源:origin: org.jasig.portal/uportal3-impl

  1. /**
  2. * @see javax.servlet.ServletRequest#getAttributeNames()
  3. */
  4. public Enumeration getAttributeNames() {
  5. final Iterator<String> attrNameItr = this.attributeValueMap.keySet().iterator();
  6. final Enumeration superAttrNameEnum = super.getAttributeNames();
  7. final Iterator superAttrNameItr = new EnumerationIterator(superAttrNameEnum);
  8. final Iterator[] allAttrNameItrs = new Iterator[] {attrNameItr, superAttrNameItr};
  9. final Iterator allAttrNameItr = new IteratorChain(allAttrNameItrs);
  10. final Iterator filteredAttrNameItr = new UniqueFilterIterator(allAttrNameItr);
  11. return new IteratorEnumeration(filteredAttrNameItr);
  12. }

相关文章

HttpServletRequestWrapper类方法