Which code snippet prints the exception error message as part of the page output?
Which code snippet prints the exception error message as part of the page output?
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.
B is correct. D will print to system console, not to the page
Answer: B