Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp customtag as an attribute?

 
Markus Meier
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks
Does anybody know, if I can use a CustomTag as a value of an attribute for an other CustomTag?
something like this?
<ejob:CheckboxTag translator="CarTranslator" field="<ejob:CheckboxTag column='DRIVING_LICENCE' />" />
------------------
-----
...may the source be with you
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Attributes can be a primitive type or any Java object, and they can be set statically (i.e. hard-coded in the JSP) or dynamically at request-time using JSP expressions. At the moment, using tags as attributes isn't possible.
What you can so though is make your tags co-operate in other ways. For example, you could nest your tags, or make them share information (implicitly or explicitly) through scripting variables on the page, or even the HTTP session.
Alternatively, take a look at some of the Standard TagLib stuff going on over at http://jakarta.apache.org/taglibs/doc/jsptl-doc/intro.html , or the summary that's available on the Wrox Press website at http://www.wrox.com/News/viewReview.asp?art_type=new&id=583 . It has its own "expression language" for accessing variables, etc.
Hope that helps...
Simon
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic