Rule.ApplyURIpublic class RewritePatternRule extends PatternRule implements Rule.ApplyURI
PathMap path with a fixed string.Rule.ApplyURI_pattern_handling, _terminating| Constructor | Description |
|---|---|
RewritePatternRule() |
|
RewritePatternRule(java.lang.String pattern,
java.lang.String replacement) |
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.String |
apply(java.lang.String target,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
Apply the rule to the request
|
void |
applyURI(Request request,
java.lang.String oldURI,
java.lang.String newURI) |
This method will add _query to the requests's queryString and also combine it with existing queryStrings in
the request.
|
void |
setReplacement(java.lang.String replacement) |
Whenever a match is found, it replaces with this value.
|
java.lang.String |
toString() |
Returns the replacement string.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetPattern, matchAndApply, setPatternisHandling, isTerminating, setHandling, setTerminatingpublic void setReplacement(java.lang.String replacement)
replacement - the replacement string.public java.lang.String apply(java.lang.String target,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException
PatternRuleapply in class PatternRuletarget - field to attempt matchrequest - request objectresponse - response objectjava.io.IOException - exceptions dealing with operating on request or response objectspublic void applyURI(Request request, java.lang.String oldURI, java.lang.String newURI) throws java.io.IOException
param1 = true and _query will contain param1=false the result will be param1=true¶m1=false.
To cover this use case some more complex pattern matching is necessary. We can implement this if there's use
cases.applyURI in interface Rule.ApplyURIrequest - the requestoldURI - the old URInewURI - the new URIjava.io.IOException - if unable to apply the URIpublic java.lang.String toString()
toString in class PatternRuleCopyright © 1995–2018 Webtide. All rights reserved.