1 16 package org.apache.cocoon.jxpath; 17 18 import java.util.Enumeration ; 19 20 import org.apache.cocoon.environment.Request; 21 import org.apache.commons.collections.EnumerationUtils; 22 import org.apache.commons.jxpath.DynamicPropertyHandler; 23 24 31 public class CocoonRequestHandler implements DynamicPropertyHandler { 32 33 public String [] getPropertyNames(Object request) { 34 final Enumeration e = ((Request) request).getAttributeNames(); 35 return (String []) EnumerationUtils.toList(e).toArray(); 36 } 37 38 public Object getProperty(Object request, String property) { 39 return ((Request) request).getAttribute(property); 40 } 41 42 public void setProperty(Object request, String property, Object value) { 43 ((Request) request).setAttribute(property, value); 44 } 45 } 46 | Popular Tags |