Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Catching a NullPointerException  RSS feed

 
Jason Kwok
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a servlet that processes a simple search after a user submits a string through a form. It works perfectly except when an ' is included. For example: O'toole. When it's included I get a NullPointerException.

I've tried to redirect the exception in my servlet like this:


In the results.jsp page, I check for the error as such:


Finally, here is the error message I get:


Any help with this would be greatly appreciated!!

Thanks,
Jason
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved from JSP at the request of the original poster.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!