Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

c:set target doubt

 
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic