• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:


From a mock exam
Which about Filters is true

A. Filters may be used to create request and response wrappers.
B. Wrappers may be used to create request or reponse filters

Correct ans given is A.
Is it correct?
I guess wrappers are used in filters shouldn't it be B.

1 Solution
yes,A is correct.

A filter acts as an interceptor to incoming HttpRequests.   You declare the filter in the web.xml and then also provide entries there which say which url patterns the filter will be applied to.

Common uses :

- SecurityFilter (ensure the request is coming from an authenticated user, if not redirect to login page)
- CompressionFilter (buffer the response, and encode with gzip compression)
- Etc.

thomas908Author Commented:
Thanks  lhankins


Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now