permaculture playing cards*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes c:set target doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "c:set target doubt" Watch "c:set target doubt" New topic
Author

c:set target doubt

Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Hi,

If we tell
<c:set var="test1" value="testing">

If an object named test1 does not exist at session scope, it is automatically created provided value is not null. What kind of
objects can only be created in this way. Can I create a HashMap
object in this way?

I know target and var can't be used together. So how can Map object be
created and assigned key and value if I don't use <jsp:useBean ...> tag
and only use <c:set>.


Thanks,


cmbhatt
Sunder Ganapathy
Ranch Hand

Joined: Apr 01, 2003
Posts: 120
c:set var is meant for Attributes only. c:set target is for bean properties and Map values only. c:set target is used for REAL OBJECTS, an actual object in existence.
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Thanks Sunder!


If bean is automatically created in case of <c:set var> if it does not
already exist and value is not null. Doesn't this rule apply with Map?


Thanks,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: c:set target doubt
 
Similar Threads
c:out how to print the values in string
Use of a page-scoped attribute
what is target in c:target??
Headfirst Servlets and Jsp <c:set> pg.457
Remove and Set