This week's book giveaway is in the Flex forum.
We're giving away four copies of Flex 4 in Action and have Tariq Ahmed, Dan Orlando, John C. Bland II & Joel Hooks on-line!
See this thread for details.
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Win a copy of Flex 4 in Action this week in the Flex forum!
Reply Bookmark it! Watch this topic JavaRanch » Forums » Professional Certification » Web Component Certification (SCWCD)
 
RSS feed
 
New topic
Author

Question on cset Target

Veena Pointi
Ranch Hand

Joined: Jun 20, 2002
Messages: 427

For <c:set target="${PetMap}" property="dogName" value="Clover"/> syntax on page 456 in HFSJ ,it says that
The target must evaluate to the OBJECT! You don't type in the string "id" name of the bean or Map attribute! With the "target" attribute ,you do not type in the String literal that represents the name under which the attribute was bound to the page,scope,etc. No,the "target" attribute needs a value that resolves to the REAL THING.


But I tried following example ,for "target" attribute I had to give name to which attribute was bound



Then,why in HFSJ it is saying that With the "target" attribute ,you do not type in the String literal that represents the name under which the attribute was bound to the page,scope,etc ?

Thanks
Veena

This message was edited 1 time. Last update was at by Veena Pointi


SCJP1.4
"Continuous effort - not strength or intelligence - is the key to unlocking our potential."
*Winston Churchill
Bob Wheeler
Ranch Hand

Joined: Apr 24, 2009
Messages: 308

Veena Pointi wrote:
Then,why in HFSJ it is saying that With the "target" attribute ,you do not type in the String literal that represents the name under which the attribute was bound to the page,scope,etc ?


Hi Veena,

You didn't use a String literal. Instead you used an EL expression (${PetMap}), which evaluates to the "real thing", the object (in your example the Map petMaps).
The following doesn't work (notice: PetMap is now a String literal):


For the c:set var property a String literal works:


I hope I could help.
cheers
Bob>

This message was edited 2 times. Last update was at by Bob Wheeler


SCJP 6 - SCJD - SCWCD 5
JavaEnterpriseEditionFaq - TomcatFaq
 
jQuery in Action
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Professional Certification » Web Component Certification (SCWCD)
 
RSS feed
 
New topic