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

Which code snippet prints the exception error message as part of the page output?

    Correct Answer: A

    To print the exception error message as part of the page output, you can use JSP expressions. The option '<%= exception.message %>' directly embeds the exception's message into the HTML content, making it suitable for displaying the message on the page. Other options like '<c:out value="${requestScope["˜javax.servlet.error.exception"]}"/>' do not directly access the exception message, and '<% exception.getMessage(); %>' or '<% System.out.println(e.getMessage()) %>' are either incorrect syntax or would print to the system console instead of the page.

Discussion
AlexGer721Option: B

B is correct. D will print to system console, not to the page

orjavaOption: B

Answer: B