Class ResponsePatternRule

public class ResponsePatternRule extends PatternRule
Sends the response code whenever the rule finds a match.
  • Constructor Details

    • ResponsePatternRule

      public ResponsePatternRule()
    • ResponsePatternRule

      public ResponsePatternRule(@Name("pattern") String pattern, @Name("code") String code, @Name("message") String message)
  • Method Details

    • setCode

      public void setCode(String code)
      Sets the response status code.
      code - response code
    • setMessage

      public void setMessage(String message)
      Sets the message for the Response.sendError(int, String) method. Reasons will only reflect if the code value is greater or equal to 400.
      message - the reason
    • 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 code and reason string.
      toString in class PatternRule