I got this question:
A JSP page myerror.jsp has been invoked as a result of an exception from another JSP page. How can you print the message contained in the exception instead of displaying the whole stack trace in myerror.jsp?
(choose 2 answers)
1. ${exception.getmessage}
2. ${exception.message}
3. ${request.exception.message}.
4. ${exception.errorMessage}
5. ${pageContext.exception.message}
6. ${requestScope["javax.servlet.error.exception"].message}
I thought that 2 would be one of the answers yet the correct answers are 5 and 6.
If 5 is correct doesn't that make 2 also correct?
any comments on the correct answers?
Thanks in advanced.