| Author |
Problem with reading values
|
bharatyadav
Greenhorn
Joined: Jul 09, 2005
Posts: 18
|
|
Hi, Iam not able to access the values from the JSP page to the Servlet class when i click submit button it showing like this :java.lang.NullPointerException Thank's in Advance
|
 |
A Kumar
Ranch Hand
Joined: Jul 04, 2004
Posts: 973
|
|
There is hardly any information for us to help you.. if possible post the complete error.... Regards
|
 |
bharatyadav
Greenhorn
Joined: Jul 09, 2005
Posts: 18
|
|
Let me explain cleary in JSP iam having fields like IDNo: Name: Matched: UserComment: I want to store the above fileds into a DataBase when i tried to read the values from jsp to servlet it is showing NULL Pointer Exception
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
Originally posted by bharatkumaryadav yadav: Let me explain cleary in JSP iam having fields like IDNo: Name: Matched: UserComment: I want to store the above fileds into a DataBase when i tried to read the values from jsp to servlet it is showing NULL Pointer Exception
What do you mean by "when I trie to read the values"? How are you reading the values? Are you posting an HTML form to the servlet and retrieving the values with the request.getParameter function? If you're having trouble explaining what you're doing, post the code. [ February 10, 2006: Message edited by: Ben Souther ]
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
vjy chin
Ranch Hand
Joined: Feb 17, 2005
Posts: 279
|
|
Hi when ou want to read a value from jsp to servlet you need to use request.getParameter(). e.g if you have a textbox in jsp with a name "id", you should use request.getParameter("id") in the servlet. Remember, the name in jsp should match the string in the request.getParameter() function. Hope this helps
|
 |
 |
|
|
subject: Problem with reading values
|
|
|