org.apache.cocoon.matching
Class HeaderMatcher

java.lang.Object
  extended byorg.apache.cocoon.matching.HeaderMatcher
All Implemented Interfaces:
org.apache.cocoon.matching.Matcher, ThreadSafe

public class HeaderMatcher
extends Object
implements org.apache.cocoon.matching.Matcher, ThreadSafe

This class allows for matching based on a request header. If the specified request header parameter exists, its value is retrieved for later sitemap substitution.

Example:

 <map:match type="header" pattern="referer">
     <map:redirect-to uri="{1}"/>
 </map:match>
 

Version:
$Id: HeaderMatcher.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Field Summary
 
Fields inherited from interface org.apache.cocoon.matching.Matcher
ROLE
 
Constructor Summary
HeaderMatcher()
           
 
Method Summary
 Map match(String pattern, Map objectModel, Parameters parameters)
          Match method to see if the request header exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeaderMatcher

public HeaderMatcher()
Method Detail

match

public Map match(String pattern,
                 Map objectModel,
                 Parameters parameters)
Match method to see if the request header exists. If it does have a value the header added to the array list for later sitemap substitution.

Specified by:
match in interface org.apache.cocoon.matching.Matcher
Parameters:
pattern - name of request header to find
objectModel - environment passed through via cocoon
Returns:
null or map containing value of request header 'pattern'


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.