Class HeaderPatternRule


public class HeaderPatternRule extends PatternRule

Puts or adds a response header whenever the rule matches a path Servlet pattern.

  • Constructor Details

    • HeaderPatternRule

      public HeaderPatternRule()
    • HeaderPatternRule

      public HeaderPatternRule(@Name("pattern") String pattern, @Name("name") String name, @Name("value") String value)
  • Method Details

    • getHeaderName

      public String getHeaderName()
    • setHeaderName

      public void setHeaderName(String name)
    • getHeaderValue

      public String getHeaderValue()
    • setHeaderValue

      public void setHeaderValue(String value)
    • isAdd

      public boolean isAdd()
    • setAdd

      public void setAdd(boolean add)
      Use true 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

      public Rule.Handler apply(Rule.Handler input) throws IOException
      Description copied from class: PatternRule

      Invoked after the Servlet pattern matched the URI path to apply the rule's logic.

      Specified by:
      apply in class PatternRule
      Parameters:
      input - the input Request and Handler
      Returns:
      the possibly wrapped Request and Handler
      Throws:
      IOException - if applying the rule failed
    • toString

      public String toString()
      Overrides:
      toString in class PatternRule