• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Catching JSP NullPointerException

 
Sivaraman Lakshmanan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
we are using Tomact as the servlet engine in production. There some issues like in JSP page we may get a NullPointerException which will just show as a blank page. If we have a try catch block in the JSP page we will know where the exception is thrown. If we don't have try catch block, will the server anywhere in the logs puts the error trace? Is there any best way to find where in JSP the exception is thrown.

Thanks in Advance.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15205
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could add a JSP error page, which is a JSP that you configure in your web application deployment descriptor (web.xml) to be called whenever an exception occurs.

See this: JavaServer Pages (JSP) Error Pages and Preventing Repeated Operations
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic