If a filter needs to perform different actions based on the type of HTTP request, which method or object should it use to determine this?

  • filterConfig.getInitParameter("requestType")
  • request.getContentType()
  • request.getMethod()
  • request.getRequestType()
To determine the type of HTTP request, the filter can use the request.getMethod() method, which returns the HTTP method (GET, POST, etc.) of the request.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *