Class RewritePatternRule

public class RewritePatternRule extends PatternRule

A rule to rewrite the path and query that match a Servlet pattern with a fixed string.

  • Constructor Details

    • RewritePatternRule

      public RewritePatternRule()
    • RewritePatternRule

      public RewritePatternRule(@Name("pattern") String pattern, @Name("replacement") String replacement)
  • Method Details

    • setReplacement

      public void setReplacement(String replacement)

      The replacement for the path and query matched by this rule.

      replacement - the replacement path
    • 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
      input - the input Request and Handler
      the possibly wrapped Request and Handler
      IOException - if applying the rule failed
    • toString

      public String toString()
      toString in class PatternRule