The HSF book has done little more than confuse this subject since answer 6D on page 497 states "<c ut value="x" /> is a custom tag. I have submitted errata for this, but I need to know what the correct answer is on the REAL exam. I ask this because according the Sun, "A custom tag is a user-defined JSP language element." This can be found at the following link:
Again, all I am looking for is what is correct for the REAL exam.
The confusion mentioned above was documented in submitted errata, which I am providing below. I will also add that although the hsf book is good, on occasion it lacks clarity (errata submitted). In addition to this issue, another example is the failure to explicitly reinforce (as opposed to package foo the fact that jsp accessed beans/classes must be placed in a package before they are visible to the jsp.
Here is the custom tag errata:
Answer 6D suggests <c ut value="x" /> is an example of custom tag usage. The paragraphs that follow suggests this is false. I also believe the book results in confusion in understanding what are standard and custom tags:
On page 2 of the spec (jstl-1_2-mrel2-spec.pdf), at the end of section 1.1 the spec states, "The other key aspect of JSTL is that it provides standard actions and standard EL functions...". The spec then goes on to list the 5 associated libraries. Furthermore, on page 31 in Section 5.2 is one of the few instances the spec refers to "custom" as a subject. Here is speaks of a custom action of the form "<acme:fullMoon>", which is clearly not part of jstl. Other reference suggest "custom" implies "programmer supplied/constructed".
Based on this information I am lead to believe the JSTL supplied tags are standard tags, and programmer supplied tags, which are tags not defined by the jstl spec, are custom tags. This is in fact the subject of Chapter 10, which states in the opening page, "Sometimes JSTL and standard actions aren't enough. When you need something custom...". However, the opening page of Chapter 9, which is titled, "Using JSTL", states, "Custom tags are powerful".
Based on the spec I believe there are JSP standard actions/tags, and JSTL standard action/tags. An action/tag that is not a member of the above groups is therefore considered a custom action/tag.
JSTL is just a tag library, made of custom tags, with its own TLDs. Standard actions are listed in the Servlets Specification. Other things are custom. You could make your own tag library too, name it the "Dee Brown Standard Library". Everybody is using it, it finally has its own spec, great. But it still is a custom tag library.
"Standard actions are listed in the Servlets Specification"
A search on "action" in v2.5 of the servlet spec failed to locate any associated reference as it relates to the subject of this post. However, page 1-32 (JSP.188.8.131.52 Standard Action Attributes) in v2.1 of the JSP spec lists actions of the form "jsp:useBean".
I guess the question should have been, "What are standard tags?". Are standard tags associated with standard actions (i.e. <jsp:forward>, <jsp:include>, <jsp:useBean>, <jsp:setProperty>, <jsp:getProperty>...). If this is correct, why are they considered standard (because they came before jstl?). If this is not correct, can anyone point me to a spec where the subject of "standard tags" discussed? Thanks in advance.
Sorry, as Bear says, I meant the JSP specification. Sorry for the confusion. By the way, you should use the Servlets 2.4 and JSP2.0 specs for this exam. Yes it's called SCWCD5, but the specs used are still those used for SCWCD1.4.
Originally posted by Jan Sterk: I agree that the terminology is poorly chosen. They should have called standard actions standard tags. Or custom tags custom actions. And the JSTL SFTL: Sun's Free Tag Library.
I disagree -- I think that would be more confusing terminology.
I think the current terminology is fine: standard actions are those defined in the JSP Specification; anything else is a custom action.
Joined: Jun 06, 2008
Originally posted by Bear Bibeault: ..anything else is a custom action.
Now I'm confused. I thought they are called custom tags!
If you're still confused, you might want to check chapters 13-17 of my book I deliberately spend ages working through standard actions, JSTL, custom tags, tag files and tag deployment as it is undoubtedly one of the trickest JSP areas on the exam - there's a lot of detail in there and some relatively tough concepts too. Feel free to check the TOC at the publisher's website (see signature).
Charles Lyons (SCJP 1.4, April 2003; SCJP 5, Dec 2006; SCWCD 1.4b, April 2004)
Author of OCEJWCD Study Companion for Oracle Exam 1Z0-899 (ISBN 0955160340 / AmazonAmazon UK )