This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • 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