Rule.ApplyURI
public 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(org.eclipse.jetty.server.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, wait
getPattern, matchAndApply, setPattern
isHandling, isTerminating, setHandling, setTerminating
public RewritePatternRule()
public RewritePatternRule(@Name("pattern") java.lang.String pattern, @Name("replacement") java.lang.String replacement)
public 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
PatternRule
apply
in class PatternRule
target
- field to attempt matchrequest
- request objectresponse
- response objectjava.io.IOException
- exceptions dealing with operating on request or response objectspublic void applyURI(org.eclipse.jetty.server.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.ApplyURI
request
- the requestoldURI
- the old URInewURI
- the new URIjava.io.IOException
- if unable to apply the URIpublic java.lang.String toString()
toString
in class PatternRule
Copyright © 1995–2018 Webtide. All rights reserved.