This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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: 924
    
    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.
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: does JSTL <c:set> create a new attribute, if none exist?
 
Similar Threads
Creating and populating a List of javaBeans in a JSP w/o using scriptlets
JSTL (c:set)
Difference betweenn c:set and jsp:useBean
<c:set>
doubt in JSTL set tag