public class RedirectPatternRule extends PatternRule
All redirects are part of the 3xx Redirection
status code set.
Defaults to 302 Found
Rule.ApplyURI
_pattern
_handling, _terminating
Constructor | Description |
---|---|
RedirectPatternRule() |
|
RedirectPatternRule(java.lang.String pattern,
java.lang.String location) |
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 |
setLocation(java.lang.String value) |
Sets the redirect location.
|
void |
setStatusCode(int statusCode) |
Sets the redirect status code.
|
java.lang.String |
toString() |
Returns the redirect status code and location.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getPattern, matchAndApply, setPattern
isHandling, isTerminating, setHandling, setTerminating
public RedirectPatternRule()
public RedirectPatternRule(@Name("pattern") java.lang.String pattern, @Name("location") java.lang.String location)
public void setLocation(java.lang.String value)
value
- the location to redirect.public void setStatusCode(int statusCode)
statusCode
- the 3xx redirect status codepublic 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 java.lang.String toString()
toString
in class PatternRule
Copyright © 1995–2018 Webtide. All rights reserved.