This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

org.apache.jasper.JasperException: java.lang.NullPointerException when JSP page refreshes

 
Laxman Chowdary
Greenhorn
Posts: 21
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my jsp page some pure java code there i.e, scriptlet. After a long time when refresh it then it is throwing
org.apache.jasper.JasperException: java.lang.NullPointerException
sometimes not for a long time also it is throwing same Exception. and the JSP page is displaying empty page. So the user have only one option is Logout. So to avoid that and redirect him to one page that is error page. How to do it??
Any idea???
 
Palak Mathur
Ranch Hand
Posts: 328
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Laxman Chowdary wrote:In my jsp page some pure java code there i.e, scriptlet. After a long time when refresh it then it is throwing
org.apache.jasper.JasperException: java.lang.NullPointerException
sometimes not for a long time also it is throwing same Exception. and the JSP page is displaying empty page. So the user have only one option is Logout. So to avoid that and redirect him to one page that is error page. How to do it??
Any idea???


I think you want to set the @errorPage attribute in the page directive:-
Something like this:

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic