This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes does JSTL <c:set> create a new attribute, if none exist? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "does JSTL <c:set> create a new attribute, if none exist?" Watch "does JSTL <c:set> create a new attribute, if none exist?" New topic
Author

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

Joe Allen
Ranch Hand

Joined: Nov 14, 2012
Posts: 93
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?


"There are no dumb questions" quoted from HFSJ. "To err is human; to forgive is divine"
OCPJP 6, OCEJWCD 6
gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 923
    
    1

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.


OCPJP 6(100 %) OCEWCD 6(91 %) OCPJBCD(93%)
Joe Allen
Ranch Hand

Joined: Nov 14, 2012
Posts: 93
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: does JSTL <c:set> create a new attribute, if none exist?
 
Similar Threads
JSTL (c:set)
Difference betweenn c:set and jsp:useBean
doubt in JSTL set tag
<c:set>
Creating and populating a List of javaBeans in a JSP w/o using scriptlets