Class RedirectPatternRule
java.lang.Object
org.eclipse.jetty.rewrite.handler.Rule
org.eclipse.jetty.rewrite.handler.PatternRule
org.eclipse.jetty.rewrite.handler.RedirectPatternRule
Issues a (3xx) redirect response whenever the rule finds a request path Servlet pattern match.
All redirects are part of the 3xx Redirection
status code set.
Defaults to 302 Found
.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.rewrite.handler.Rule
Rule.Handler, Rule.HttpURIHandler
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapply
(Rule.Handler input) Invoked after the Servlet pattern matched the URI path to apply the rule's logic.int
boolean
void
setLocation
(String value) Set the location to redirect.void
setStatusCode
(int statusCode) Set the 3xx redirect status code.toString()
Methods inherited from class org.eclipse.jetty.rewrite.handler.PatternRule
getPattern, matchAndApply, setPattern
Methods inherited from class org.eclipse.jetty.rewrite.handler.Rule
setTerminating
-
Constructor Details
-
RedirectPatternRule
public RedirectPatternRule() -
RedirectPatternRule
-
-
Method Details
-
isTerminating
public boolean isTerminating()- Overrides:
isTerminating
in classRule
- Returns:
- whether rules after this one are not invoked
-
getLocation
-
setLocation
Set the location to redirect.- Parameters:
value
- the location to redirect.
-
getStatusCode
public int getStatusCode() -
setStatusCode
public void setStatusCode(int statusCode) Set the 3xx redirect status code.- Parameters:
statusCode
- the 3xx redirect status code
-
apply
Description copied from class:PatternRule
Invoked after the Servlet pattern matched the URI path to apply the rule's logic.
- Specified by:
apply
in classPatternRule
- Parameters:
input
- the inputRequest
andHandler
- Returns:
- the possibly wrapped
Request
andHandler
- Throws:
IOException
- if applying the rule failed
-
toString
- Overrides:
toString
in classPatternRule
-