Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Differentiate Custom Tags and JSTL - HF Chapter 9 Mock Exam

 
Manikandan Jayaraman
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am preparing for the SCWCD exam using the HF Servlets and JSPs book. I was doing the mock exam of chapter 9 and was confused at Q-6. The question is this!

Assuming the appropriate taglib directives, which are valid examples of custom tag usage:
A. <foo:bar />
B. <my:tag></my:tag>
C. <mytag value="x" />
D. <c ut value="x" />
E. <jsp:setProperty name="a" property="b" value="c" />

The answer acc. to the book was A, B and D.

When option E was rejected in the book, saying that it is a JSP Standard Action, why not Option-D was rejected?

Option D is anyway a JSTL and not a custom tag and the question clearly states "for custom tag usage".

Can someone help me out?

Regards,
Mani
 
Saurabh Chaubey
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Manikandan,
JSTL is a set of custom tags which have been made by somebody else to make our lives easier.Remember, JSTL are not a part of JSP 2.0 specs.You have to explicitly put the jstl jar file in your WEB-INF/lib directory inorder to use it.

So, option D is Correct.

Regards,
Saurabh
 
Frederic Esnault
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perfect explanation. JSTL Core tags library as well as XML, SQL, Formatting, Internalization (....) are all custom tags. They are just already developped for you.
 
Denis Zjukow
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the question tag <c ut ... /> may be not JSTL "out" tag, as there is no information about that, but any custom tag which just looks the same. Prefix "c" is not reserved so you can use it to bind any custom tag library.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic