• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting null values, when displaying values using usebean

 
Punit Jain
Ranch Hand
Posts: 1014
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why i m getting null values.??
Here is my code:
index.jsp


BeanClass.java


setBean.jsp

getBean.jsp
 
Stefan Evans
Bartender
Posts: 1782
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to match up the names of the input fields/parameters to the names of the attributes in your bean.

e.g. your textfield for name is currently called "txt_name"
This will look for the method setTxt_name() in your bean which doesn't exist.

I would suggest:


I also note that contact is an int in your bean.
You are submitting contact from a textfield, which means there possibly needs to be validation/conversion on that field to turn it into an int. What happens if the user doesn't provide a valid number?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic