public class RewriteRegexRule extends RegexRule implements Rule.ApplyURI
Rule.ApplyURI
_handling, _terminating
Constructor and Description |
---|
RewriteRegexRule() |
Modifier and Type | Method and Description |
---|---|
String |
apply(String target,
HttpServletRequest request,
HttpServletResponse response,
Matcher matcher)
Apply this rule to the request/response pair.
|
void |
applyURI(Request request,
String oldURI,
String newURI) |
void |
setReplacement(String replacement)
Whenever a match is found, it replaces with this value.
|
String |
toString()
Returns the replacement string.
|
getRegex, matchAndApply, setRegex
isHandling, isTerminating, setHandling, setTerminating
public void setReplacement(String replacement)
replacement
- the replacement string.public String apply(String target, HttpServletRequest request, HttpServletResponse response, Matcher matcher) throws IOException
RegexRule
RegexRule.matchAndApply(String, HttpServletRequest, HttpServletResponse)
if the regex matches.apply
in class RegexRule
target
- field to attempt matchrequest
- request objectresponse
- response objectmatcher
- The Regex matcher that matched the request (with capture groups available for replacement).IOException
- exceptions dealing with operating on request or response objectspublic void applyURI(Request request, String oldURI, String newURI) throws IOException
applyURI
in interface Rule.ApplyURI
IOException
Copyright © 1995-2015 Webtide. All Rights Reserved.