aspose file tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Question on cset Target Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Professional Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "Question on cset Target" Watch "Question on cset Target" New topic
Author

Question on cset Target

Veena Pointi
Ranch Hand

Joined: Jun 20, 2002
Posts: 442
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
Posts: 317
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 - SCBCD 5
JavaEnterpriseEditionFaq - TomcatFaq
 
 
subject: Question on cset Target
 

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture