A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Error in hashtable put method
Joined: Jul 16, 2009
Jul 16, 2009 07:20:04
this is the code I've given in a
class, which is fetching values from a
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 ?
Author and ninkuma
Joined: Jan 10, 2002
Jul 16, 2009 07:49:25
Do you not think that showing us the error might be useful?
Asking smart questions
Books by Bear
Author and all-around good cowpoke
Joined: Mar 22, 2000
Jul 16, 2009 12:13:39
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.
subject: Error in hashtable put method
Data representation for Hashtable where key is unknown
Passing my object to one to other activity
Synchronized HashMap Vs Hashtable
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014