Multiple choice technology programming languages

Servlet A receives a request that it forwards to servlet B within another web application in the same web container. Servlet A needs to share data with servlet B and that data must not be visible to other servlets in A's web application. In which object can the data that A shares with B be stored?

  1. HttpSession

  2. ServletConfig

  3. ServletContext

  4. HttpServletRequest

  5. HttpServletResponse

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

The HttpServletRequest object is passed during a request forward. Attributes stored in the request are shared only with the forwarded resource for that specific request lifecycle, keeping them invisible to other sessions or unrelated servlets.