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.
Loading...
Related Quiz
- What is the role of a servlet filter in security?
- The __________ method of the FilterChain interface is used to invoke the next filter in the chain.
- A web application experiences intermittent database connection issues. What connection pooling feature should be evaluated to resolve this?
- Can a filter modify the request and response objects?
- The _________ method is used to retrieve cookies from the request object.