• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in retriving List objects  RSS feed

 
Amit Kumar Thakur
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, i am trying to print values in a jsp page Customer.jsp taken from AccountDetailDAO. At first page goes through LoginValidation but i am getting NullPointerException in line 83.
It works fine when i am login as a manager.
Here are the relevant codes
LoginValidation.java

Customer.jsp

AccountDetailDAO
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36446
454
Eclipse IDE Java VI Editor
 
Amit Kumar Thakur
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have already marked that in LoginValidaion.java .
 
Avinash venna
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the getDispatcher method takes path as an argument. most probably the path here is wrong. Try checking that.. you may try /Customer.jsp
 
Alex Theedom
Author
Ranch Hand
Posts: 77
5
Java Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A null pointer will occur if a method is called on an object that is null and according to the API doc the getRequestDispatcher() method "returns null if the servlet container cannot return a RequestDispatcher".

I attempted to replicate this in my environment without success. I am using Tomcat 7 and if the path argument in the getRequestDispatcher() is not valid it does not throw a null pointer exception, instead the servlet sends an HTTP 404 message code to the browser.

Investigating this further I found this post by Charles Lyons that talks in detail about this: http://www.coderanch.com/t/453276/java-Web-Component-SCWCD/certification/RequestDispatcher-null-outcome. It appears that server implementation determines the behaviour.

Would you post the stack trace if correcting the path does not solve it.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!