Class RedirectPatternRule

public class RedirectPatternRule extends PatternRule
Issues a (3xx) Redirect response whenever the rule finds a match.

All redirects are part of the 3xx Redirection status code set.

Defaults to 302 Found

  • Constructor Details

    • RedirectPatternRule

      public RedirectPatternRule()
    • RedirectPatternRule

      public RedirectPatternRule(@Name("pattern") String pattern, @Name("location") String location)
  • Method Details

    • setLocation

      public void setLocation(String value)
      Sets the redirect location.
      value - the location to redirect.
    • setStatusCode

      public void setStatusCode(int statusCode)
      Sets the redirect status code.
      statusCode - the 3xx redirect status code
    • apply

      public String apply(String target, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
      Description copied from class: PatternRule
      Apply the rule to the request
      Specified by:
      apply in class PatternRule
      target - field to attempt match
      request - request object
      response - response object
      The target (possible updated)
      IOException - exceptions dealing with operating on request or response objects
    • toString

      public String toString()
      Returns the redirect status code and location.
      toString in class PatternRule