Java Server Pages (JSP) could handle any erros that might be arised in scriptlets, expressions, or other JSP elements. You could use try/cacth blocks to handle any known erros. In this technic we could use to display a custom error on our file where ...
An article on exception handling in JSP pages. Describes how to catch exceptional events and display a useful message to the user. Online demo available.