Class ResponsePatternRule
java.lang.Object
org.eclipse.jetty.rewrite.handler.Rule
org.eclipse.jetty.rewrite.handler.PatternRule
org.eclipse.jetty.rewrite.handler.ResponsePatternRule
Sends the response code whenever the rule finds a match.
-
Nested Class Summary
Nested classes/interfaces inherited from class Rule
Rule.Handler, Rule.HttpURIHandler -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(Rule.Handler input) Invoked after the Servlet pattern matched the URI path to apply the rule's logic.intgetCode()booleanvoidsetCode(int code) Set the response code.voidsetMessage(String message) Sets the message for the response body (if the response code may have a body).toString()Methods inherited from class PatternRule
getPattern, matchAndApply, setPatternMethods inherited from class Rule
setTerminating
-
Constructor Details
-
ResponsePatternRule
public ResponsePatternRule() -
ResponsePatternRule
-
-
Method Details
-
isTerminating
public boolean isTerminating()- Overrides:
isTerminatingin classRule- Returns:
- whether rules after this one are not invoked
-
getCode
public int getCode() -
setCode
public void setCode(int code) Set the response code.- Parameters:
code- the response code
-
getMessage
-
setMessage
Sets the message for the response body (if the response code may have a body).
- Parameters:
message- the response message
-
apply
Description copied from class:PatternRuleInvoked after the Servlet pattern matched the URI path to apply the rule's logic.
- Specified by:
applyin classPatternRule- Parameters:
input- the inputRequestandHandler- Returns:
- the possibly wrapped
RequestandHandler - Throws:
IOException- if applying the rule failed
-
toString
- Overrides:
toStringin classPatternRule
-