File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Error in hashtable put method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Error in hashtable put method" Watch "Error in hashtable put method" New topic
Author

Error in hashtable put method

Prem kris
Greenhorn

Joined: Jul 16, 2009
Posts: 4
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

Joined: Jan 10, 2002
Posts: 56168
    
  13

Do you not think that showing us the error might be useful?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12266
    
    1
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


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error in hashtable put method
 
Similar Threads
Synchronized HashMap Vs Hashtable
Passing my object to one to other activity
Data representation for Hashtable where key is unknown
enthuware question
Hashmap