Parent Directory | Revision Log | Patch
--- cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper/RequestWrapper.java 2005/04/29 09:09:44 165283 +++ cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper/RequestWrapper.java 2005/04/29 09:24:28 165284 @@ -93,9 +93,8 @@ public final class RequestWrapper extend String value = this.parameters.getParameter(name); if (value == null && !this.rawMode) { return this.req.getParameter(name); - } else { - return value; } + return value; } /* (non-Javadoc) @@ -114,9 +113,8 @@ public final class RequestWrapper extend parameterNames.add(names.nextElement()); } return new EnumerationFromIterator(parameterNames.iterator()); - } else { - return this.parameters.getParameterNames(); } + return this.parameters.getParameterNames(); } final class EnumerationFromIterator implements Enumeration { @@ -144,9 +142,8 @@ public final class RequestWrapper extend System.arraycopy(values, 0, allValues, 0, values.length); System.arraycopy(inherited, 0, allValues, values.length, inherited.length); return allValues; - } else { - return this.parameters.getParameterValues(name); } + return this.parameters.getParameterValues(name); } /* (non-Javadoc) @@ -191,9 +188,8 @@ public final class RequestWrapper extend public Object getAttribute(String name, int scope) { if ( scope == Request.GLOBAL_SCOPE ) { return super.getAttribute(name, scope); - } else { - return this.requestAttributes.get( name ); } + return this.requestAttributes.get( name ); } /* (non-Javadoc) @@ -202,9 +198,8 @@ public final class RequestWrapper extend public Enumeration getAttributeNames(int scope) { if ( scope == Request.GLOBAL_SCOPE ) { return super.getAttributeNames(scope); - } else { - return IteratorUtils.asEnumeration(this.requestAttributes.keySet().iterator()); } + return IteratorUtils.asEnumeration(this.requestAttributes.keySet().iterator()); } /* (non-Javadoc) @@ -229,4 +224,17 @@ public final class RequestWrapper extend } } + /** + * @see org.apache.cocoon.environment.Request#searchAttribute(java.lang.String) + */ + public Object searchAttribute(String name) { + Object result = this.getAttribute(name, REQUEST_SCOPE); + if ( result == null ) { + result = this.getAttribute(name, GLOBAL_SCOPE); + if ( result == null ) { + result = this.req.getAttribute(name, REQUEST_SCOPE); + } + } + return result; + } }
infrastructure at apache.org | ViewVC Help |
Powered by ViewVC 1.1.26 |