| Author |
null pointer exception after session expire
|
Sunil Chavan
Greenhorn
Joined: Apr 11, 2007
Posts: 28
|
|
In my jsp i m using tree tag by jenkov. But after session expired if i click on any tree node it gives null pointer exception. To tackle it i put my code in if...else... condition as follows. if(null == session) { // session is null so redirect it to the home page. response.sendRedirect(request.getContextPath() + CommonConstants.REDIRECT_URL); }else{ //tree tag code here.. } Below if...else i dont have any code except few end tags of html (like </body> & </html> But even though taking care of everything it still gives me null pointer exception if i click on any node after session expire. What could be the reason behind this and how can i resolve it.
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
As with any NullPointerException, the first thing to find when trying to solve the problem is the variable that is null. Have you gone through the logs to see if there is a stack trace in there? If so, find out what line of code is throwing the exception and find out what variable on that line is null.
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
 |
|
|
subject: null pointer exception after session expire
|
|
|