You can use a try-catch block using scriptlets in your JSP and display the error in the catch block. Or you can use an error page in your web application configuration or in the page directive of your JSP. But I think in the second case if the output is flushed to the client, then the error page will not be displayed.
Here is how you can put a try-catch block to your JSP page
Except of course, that scriptlets in JSPs should no longer be used.
Also, please use real words when posting to the forums. Abbreviations such as "mtd" in place of whatever it's supposed to mean (I have no clue) only serve to make your posts more difficult to read and less likely to generate useful responses.