Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Choose the right answer

 
Sreeraj G Harilal
Ranch Hand
Posts: 310
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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" />
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A,B,D are correct
C is incorrect because there is no prefix.
E is also incorrect because it is JSP standard action.
 
Sreeraj G Harilal
Ranch Hand
Posts: 310
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think option D is incorrect because the question asking "which are valid examples of custom tag.

<c ut value="x"> is not a custom tag. It's a standard tag.

I am right?
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think so, its not mentioned in the question that prefix "c" points to which taglib. i can make my own tag as "out"

So i think D is correct
[ December 01, 2006: Message edited by: Ali Gohar ]
 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No even if its not developed by you its not a standard action.All standard actions start with <jsp:....But c ut is a custom tag developed by java for convenience
 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry developed by sun :-)
 
Sreeraj G Harilal
Ranch Hand
Posts: 310
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks all
 
Bryan Basham
author
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Just for clarification: There are only two types of dynamic tags: standard tags and custom tags. Standard tags are "built-in" and do not require a taglib directive to use them. Custom tags do require a taglib. JSTL is a set of custom tags; actually a set of four custom tag libraries (core, I18N, SQL, and XML).

And of course, there are also static tags. HTML falls into this category, but if you are creating XML documents, then XML tags are also static. Note that it can get confusing to look at an "JSP document" (which must be in pure XML syntax) with XML namespaces and distinguish between static XML tags with namespaces and dynamic tags (which also use namespace prefixes).

HTH,
Bryan
[ December 03, 2006: Message edited by: Bryan Basham ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic