File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in hashtable put method

 
Prem kris
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,

this is the code I've given in a java class, which is fetching values from a jsp page

infoList.put("compname",request.getParameter("companyname")); // this is the part i'm getting errors

where infoList is a Hashtable object which is declared like "Hashtable infoList = new Hashtable();"

Can someone tell me a solution to solve this ?

Regs
Prem
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you not think that showing us the error might be useful?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hereby bet that the error is a NullPointerException due to the fact that Hashtable does not allow null keys or values.

A wise programmer would verify that the code

is not returning null.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic