Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

does JSTL <c:set> create a new attribute, if none exist?

 
Joe Allen
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In HFSJ p457, it says, "If the attribute named by "var" does not exist, it will be created, but only if "value" is not null".

In JSTL spec, I cannot find the above described in it under 4.3 <c:set> (p24).

The question is: is it true as it is described in HFSJ p457?

 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is correct. you can yourself test it also. if the attribute named by var already exists in the specified scope and the value specified is not null then it will be overwritten. also if the value is null the attribute will be removed.
 
Joe Allen
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the answer.
After I saw some inconsistencies, errdata, and misprintings in Servlet 3.0 specs, some books, and mock exams, I am now suspicious of anything that I read. A skeptic gone exteme.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic