Class Substitution

java.lang.Object
org.apache.catalina.valves.rewrite.Substitution

public class Substitution extends Object
Represents a URL substitution pattern for rewrite rules. Supports back-references to rewrite rules and conditions, server variables, and map lookups.
  • Field Details

  • Constructor Details

    • Substitution

      public Substitution()
      Constructs a new Substitution.
  • Method Details

    • getSub

      public String getSub()
      Returns the raw substitution string.
      Returns:
      the substitution string
    • setSub

      public void setSub(String sub)
      Sets the raw substitution string to be parsed.
      Parameters:
      sub - the substitution string
    • parse

      public void parse(Map<String, RewriteMap> maps)
      Parses the substitution string into individual elements.
      Parameters:
      maps - the available rewrite maps
    • evaluate

      public String evaluate(Matcher rule, Matcher cond, Resolver resolver)
      Evaluate the substitution based on the context.
      Parameters:
      rule - corresponding matched rule
      cond - last matched condition
      resolver - The property resolver
      Returns:
      The substitution result