1 16 package org.apache.cocoon.matching; 17 18 import org.apache.avalon.framework.parameters.Parameters; 19 import org.apache.avalon.framework.thread.ThreadSafe; 20 import org.apache.cocoon.environment.ObjectModelHelper; 21 import org.apache.cocoon.environment.Request; 22 23 import java.util.HashMap ; 24 import java.util.Map ; 25 26 41 public class HeaderMatcher implements Matcher, ThreadSafe 42 { 43 52 public Map match(String pattern, Map objectModel, Parameters parameters) { 53 Request request = ObjectModelHelper.getRequest(objectModel); 54 55 String value = request.getHeader(pattern); 56 if (value == null) { 57 return null; } else { 59 Map map = new HashMap (); 60 map.put("1", value); 61 return map; } 63 } 64 } 65 | Popular Tags |