Exam 1z0-900 All QuestionsBrowse all questions from this exam
Question 54

Your web application requires logic to remember items that a user placed into a shopping cart.

Which two mechanisms should you use to associate that information with the user? (Choose two.)

    Correct Answer: C, D

    To remember items that a user placed into a shopping cart across multiple interactions, you can use HttpSession objects and a database. HttpSession objects are designed to store user-specific data on the server across multiple requests within a session. Using a database allows you to persist this information across sessions and provide a robust, long-term storage solution. While ServletContext can store global web application data, it is not suitable for user-specific data, and HttpServletResponse is used for writing HTTP responses back to the client, not storing session data.

Discussion
orjavaOptions: BC

Answer B, C. ServletResponse not useful. Database not needed.

peteVlnOptions: BC

I think answers are BC, because a data base is not in the Web App as a resource.

CachorroOptions: BD

Answer is BD

devmsalehOptions: CD

Answer is C,D

emtchanOptions: CD

The answers should be C (HttpSession objects) and D (a database).