is there a way to redirect all NullPointerExceptions to a pretty jsp page perhaps in Struts?
Thanks in advance!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is a
struts-config.xmlconfiguration that allows you to define a exception hanbler:Here we catched java.lang.Exception and his descendants but you can changed to NullPointerException. An the handler should extend org.apache.struts.action.ExceptionHandler and forward via mapping.findForward (like @Kevin Crowell said) or other method of yous choice.
Hope that helps.