• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

c:set with target

 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

My Person bean is

in jsp code i am trying to set property(firstName) of bean(Person) with value King.Then i am displaying firstName of Person bean,but there is no value(King) present in bean.
I think there is something missing at target.
please help me
Thanks.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is this ${Person} variable coming from ? I think that it's referring to nothing. Maybe you want to use a bean here.

 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then What is fun of c:set if we have to use jsp:useBean with c:set
c:set should be independent of jsp:useBean
Any way thanks
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where's the fun ? Well you can use JavaBeans or Map as a target of c:set. Moreover, the target attribute is optional. So you can use c:set to set a value of a variable like :
<c:set var="varName" value="value" />
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic