Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with reading values

 
bharatyadav
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is hardly any information for us to help you..

if possible post the complete error....

Regards
 
bharatyadav
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
vjy chin
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic