Class RequestParameter
java.lang.Object
org.ocpsoft.rewrite.config.DefaultConditionBuilder
org.ocpsoft.rewrite.servlet.config.HttpCondition
org.ocpsoft.rewrite.servlet.config.RequestParameter
- All Implemented Interfaces:
Condition,ConditionBuilder,Parameterized
A
Condition that inspects values returned by ServletRequest.getParameterMap()- Author:
- Lincoln Baxter, III
-
Method Summary
Modifier and TypeMethodDescriptionstatic RequestParametercaptureValue(String name) Creates aRequestParametercondition that will capture the value of the the given request parameter if it exists so you can bind to it using.where().booleanevaluateHttp(HttpServletRewrite event, EvaluationContext context) static RequestParameterCreate aConditionthat matches against the existence of a request parameter with a name matching the given pattern.Get theParameterizedPatternof the request parameter name.Get theParameterizedPatternof the request parameter value.static RequestParameterCreate aConditionthat matches against both request parameter names and values.static RequestParametermatchesAll(String name, String value) voidsetParameterStore(ParameterStore store) static RequestParametervalueExists(String value) Create aConditionthat matches only against the existence of a request parameter value matching the given pattern.Methods inherited from class org.ocpsoft.rewrite.servlet.config.HttpCondition
evaluateMethods inherited from class org.ocpsoft.rewrite.config.DefaultConditionBuilder
and, andNot, or, orNot
-
Method Details
-
matches
Create aConditionthat matches against both request parameter names and values.Parameter name and value expressions may be parameterized:
RequestParameter.matches("username", "guest")
RequestParameter.matches("username", "{name}")
RequestParameter.matches("{anything}", "{value}")
- Parameters:
name-ParameterizedPatternmatching the request parameter name.value-ParameterizedPatternmatching the request parameter value.- See Also:
-
matchesAll
-
captureValue
Creates aRequestParametercondition that will capture the value of the the given request parameter if it exists so you can bind to it using.where().- Parameters:
name- The name of the request parameter
-
exists
Create aConditionthat matches against the existence of a request parameter with a name matching the given pattern. The parameter value is ignored.Parameter name expressions may be parameterized:
RequestParameter.exists("username")
RequestParameter.exists("{name}")
...- Parameters:
name-ParameterizedPatternmatching the request parameter name.- See Also:
-
valueExists
Create aConditionthat matches only against the existence of a request parameter value matching the given pattern. The parameter name is ignored.Parameter value expressions may be parameterized:
RequestParameter.valueExists("guest")
RequestParameter.valueExists("{username}")
...- Parameters:
name-ParameterizedPatternmatching the request parameter name.- See Also:
-
evaluateHttp
- Specified by:
evaluateHttpin classHttpCondition
-
getNameExpression
Get theParameterizedPatternof the request parameter name. -
getValueExpression
Get theParameterizedPatternof the request parameter value. -
getRequiredParameterNames
- Specified by:
getRequiredParameterNamesin interfaceParameterized
-
setParameterStore
- Specified by:
setParameterStorein interfaceParameterized
-