• Post Reply Bookmark Topic Watch Topic
  • New Topic

EPractice Lab mock exam 3 HttpServletRequestWrapper modify the header of a request?  RSS feed

Himai Minh
Ranch Hand
Posts: 1572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Which of the following statements are true about HttpServletRequestWrapper class?
Choose 3
A. The HttpServletRequestWrapper is an example of the wrapper pattern.
B. The HttpSerlvetResponseWrapper is an example of decorator pattern.
C. HttpServletRequestWrapper can be used to extend the functionality of a servlet request
D. HttpServletRequestWrapper may modify the header of a request within an object implementing the javax.servlet.Filter interface.

Given answers are A, B, D.
But I think it should be A, B, C.
For D, from HttpServletRequestWrapper API, I don't see any setter to modify a header of a request.

In HttpServletResponseWrapper API, I see setHeader method to modify the header of a response.
I think C is correct because the wrapper decorates the request.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!