nerdexam
Oracle

1Z0-899 · Question #152

1Z0-899 Question #152: Real Exam Question with Answer & Explanation

Sign in or unlock 1Z0-899 to reveal the answer and full explanation for question #152. The question stem and answer options stay visible for context.

Question

Assume a JavaBean com.example.GradedTestBean exists and has two attributes. The attribute name is of type java.lang.String and the attribute score is of type java.lang.Integer. An array of com.example.GradedTestBean objects is exposed to the page in a request-scoped attribute called results. Additionally, an empty java.util.HashMap called resultMap is placed in the page scope. A JSP page needs to add the first entry in results to resultMap, storing the name attribute of the bean as the key and the score attribute of the bean as the value. Which code snippet of JSTL code satisfies this requirement?

Options

  • A${resultMap[results[0].name] = results[0].score}
  • B<c:set var="${resultMap}" key="${results[0].name}"
  • C<c:set var="resultMap" property="${results[0].name}">
  • D<c:set var="resultMap" property="${results[0].name}"
  • E<c:set target="${resultMap}" property="${results[0].name}"

Unlock 1Z0-899 to see the answer

You've previewed enough free 1Z0-899 questions. Unlock 1Z0-899 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Full 1Z0-899 Practice