• Post Reply Bookmark Topic Watch Topic
  • New Topic

NullPointerException error with requestDispatcher.forward() statement  RSS feed

 
Greenhorn
Posts: 18
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got below error in my servlet while getting two values, username & password, from jsp. As I want to put them in my database I have just
add CheckSrvlt.java while running this I got below error message..

java.lang.NullPointerException
org.apache.jsp.Home_jsp._jspService(Home_jsp.java:113)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
CheckSrvlt.doPost(CheckSrvlt.java:66)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


Here is my CheckSrvlt doPost():



Anyone have the idea...? Once i have tried out by removing coockies of my browser as it gives me http status 500 message, some site suggest me to do like that.. but it's not working.. Thanks..in advance..I know that here, masters of JAVA are available..and give me the exact idea..why this error occurred.
 
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post your jsp code. My first guess would be a misspelling somewhere (case matters) because one or both of your parameters are null.

You can use FireBug to see what parameters are being sent.
 
Gautam Joshi
Greenhorn
Posts: 18
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, there is not any kind of spelling mistakes in my code.., but I am using wamp server and at the time of running this code..wamp is not running. That's the only reason why I got NPE error.

And yes, thanks for your reply. I appreciate it.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure the path of home.jsp is correct. If it is not in default folder, then give its complete path.
 
His brain is the size of a cherry pit! About the size of this ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!