Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

custom tags for dynamic values inside JSTL tags

 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1st case - custom tags for dynamic values inside JSTL tags:


Question 1: is this allowed ?
I believe the Taglib standard does not allow nesting custom tag inside the
attribute of another custom tag.
Am i right or wrong ?

-----------------
2nd case - custom tags for dynamic values inside other custom tags:

Question 2 : is this allowed ?
[ December 01, 2006: Message edited by: Max Fernandes ]
 
Bryan Basham
author
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Max,

The answer to question #1 is "no, you cannot have custom tags inside of attributes of JSTL tags". However, there is a mechanism that permits this type of functionality by using the <jsp:attribute> standard action. See JSP spec for details. NOTE: this is not on the SCWCD exam.

The answer to question #2 is the same as for #1. No tags allow nested tag calls in the text of attributes: not custom tags, not JSTL (which are also custom tags), and not standard tags. "You just can't do it," Frank Zappa (Dinah-Moe-Hum).

-Bryan
 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey Bryan, thanks very much for these explanations.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!