nerdexam
Oracle

1Z0-899 · Question #178

Given an HttpServletRequest request: 22. String id = request.getParameter("jsessionid"); 23. // insert code here 24. String name = (String) session.getAttribute("name") Which three can be placed at…

The correct answer is A. HttpSession session = request.getSession(); C. HttpSession session = request.getSession(true); D. HttpSession session = request.getSession(false). See the full explanation below for the reasoning.

Question

Given an HttpServletRequest request: 22. String id = request.getParameter("jsessionid"); 23. // insert code here 24. String name = (String) session.getAttribute("name") Which three can be placed at line 23 to retrieve an existing HttpSession object? (Choose three)

Options

  • AHttpSession session = request.getSession();
  • BHttpSession session = request.getSession(id);
  • CHttpSession session = request.getSession(true);
  • DHttpSession session = request.getSession(false);
  • EHttpSession session = request.getSession("jsessionid");

How the community answered

(33 responses)
  • A
    76% (25)
  • B
    9% (3)
  • E
    15% (5)

Community Discussion

No community discussion yet for this question.

Full 1Z0-899 Practice