Class HeaderPatternRule
java.lang.Object
org.eclipse.jetty.rewrite.handler.Rule
org.eclipse.jetty.rewrite.handler.PatternRule
org.eclipse.jetty.rewrite.handler.HeaderPatternRule
Puts or adds a response header whenever the rule matches a path Servlet pattern.
-
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.boolean
isAdd()
void
setAdd
(boolean add) Usetrue
to add the response header,false
to put the response header.void
setHeaderName
(String name) void
setHeaderValue
(String value) toString()
Methods inherited from class org.eclipse.jetty.rewrite.handler.PatternRule
getPattern, matchAndApply, setPattern
Methods inherited from class org.eclipse.jetty.rewrite.handler.Rule
isTerminating, setTerminating
-
Constructor Details
-
HeaderPatternRule
public HeaderPatternRule() -
HeaderPatternRule
-
-
Method Details
-
getHeaderName
-
setHeaderName
-
getHeaderValue
-
setHeaderValue
-
isAdd
public boolean isAdd() -
setAdd
public void setAdd(boolean add) Usetrue
to add the response header,false
to put the response header.- Parameters:
add
-true
to add the response header,false
to put the response header.
-
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
-