• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp:getProperty gives null

 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created bean class in my package.


how i set the values for bean class using jsp setproperty
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but still it gives null

 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the useBean instance is different . give the id attribute name as same name
 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I change it as below.then it says " duplicate local variable name mybean "

 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


if you want to get the value just use <jsp:getProperty name="mybean" property="name"/> . no need to create the same bean again.

it is like below.which will cause compile time error.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic