com.caucho.rewrite
Class IfQueryParam

java.lang.Object
  extended by com.caucho.rewrite.IfQueryParam
All Implemented Interfaces:
CacheablePredicate, RequestPredicate

@Configurable
public class IfQueryParam
extends java.lang.Object
implements RequestPredicate, CacheablePredicate

Passes if the named parameter exists and has a value that matches a regular expression.

 <web-app xmlns:resin="urn:java:com.caucho.resin">

   <resin:Forbidden regexp="^/local/">
     <resin:IfQueryParam name="foo" regexp="bar"/>
   </resin:Forbidden>

 </web-app>
 

RequestPredicates may be used for both security and rewrite conditions.


Constructor Summary
IfQueryParam()
           
 
Method Summary
 void init()
           
 boolean isMatch(HttpServletRequest request)
          True if the predicate matches.
 void setName(java.lang.String name)
          Sets the name of the query parameter to test.
 void setRegexp(java.util.regex.Pattern regexp)
          Sets the regular expression to compare against the query parameter.
 void setValue(java.util.regex.Pattern regexp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IfQueryParam

public IfQueryParam()
Method Detail

setName

@Configurable
public void setName(java.lang.String name)
Sets the name of the query parameter to test.

Parameters:
name - the name of the parameter.

setRegexp

@Configurable
public void setRegexp(java.util.regex.Pattern regexp)
Sets the regular expression to compare against the query parameter.

Parameters:
regexp - the regular expression to test

setValue

public void setValue(java.util.regex.Pattern regexp)

init

@PostConstruct
public void init()

isMatch

public boolean isMatch(HttpServletRequest request)
True if the predicate matches.

Specified by:
isMatch in interface CacheablePredicate
Specified by:
isMatch in interface RequestPredicate
Parameters:
request - the servlet request to test