Multiple choice technology web technology

Which retrieves all cookies sent in a given HttpServletRequest request?

  1. request.getCookies()

  2. request.getAttributes()

  3. request.getSession (). GetAttributes()

  4. request.getSession ().getCookies()

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

HttpServletRequest.getCookies() returns an array of Cookie objects sent with the request. The other options are incorrect: getAttributes() is for request attributes, and getSession() returns the HttpSession object which has different methods.