Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

nullpointerexception in a bean

 
Komal Amaresh
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I' am retrieving data in HashMaps for multiple columns to be displayed in a jsp from two database tables. As I' am calling the data from two tables, the columns set as the key in each hashmap is not present in both tables. Thereby passing the values in a bean to be displayed on a jsp returns a null pointer exception as the keys for all the values are not the same. In such cases, the data on the jsp the data may be be set as a blank column. but first i need a way to handle the nullpointerexception.
Please help me.

Thanks in advance,
regards,
Komal
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try to debug and find the line which cause NullPointerException. also post your code *part*.

by the way: I feel your explanation(question) is not clear
 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well simply check if the target object is null.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic