• Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding <c:set> with target property

 
Jay Shukla
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am preparing for SCWCD and using HFSJ for this. In HFSJ (Pg. 457) it is mentioned that

"target s not for the attribute name of bean or Map - it's for the actual attribute object." (Statement 1)

"If the target expression is not a Map or a bean, the Container throws an exception." (Statement 2)


Could anyone please let me know what is the meaning Statement 1 and Statement 2.

What exactly it is conveying?

Thanks,

Jay.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to set some values of a bean, or put some values in a Map, you can use the "target" attribute of the c:set tag. For example, to set the name of a bean whose name is "rancher" :


If you use the "target" attribute to set a value, the target must resolve to either a bean, or a Map.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65678
129
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correction:

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!