• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with reading values

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Space pants. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic