• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tag value in tag attribute

 
FredLoney
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I insert a tag value in a second tag attribute. E.g.
given:
<%@ taglib uri="..." prefix="tags" %>
<tags:myTag param="value"/>
I want to replace "value" by the result of apply a second tag. I suppose it is possibile is to define and set a String variable, e.g.:
<%! String value; %>
<% value = %><tags:lookupTag param="key"/><% ; %>
<tags:myTag param="<%= value %>"/>
but that is cumbersome. Is there a better alternative?
I'm using Jakarta Struts taglibs.
[This message has been edited by Fred Loney (edited April 24, 2001).]
 
Angela Lamb
Ranch Hand
Posts: 156
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think using a scripting variable will work for this problem:

Look here for more info on how to do this: http://java.sun.com/products/jsp/tutorial/TagLibraries13.html#62280
 
Cynthia Yao
Ranch Hand
Posts: 92
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have u think about nested tags, you can share valuables between the tags. Or setting a paga level valuable that can be accessed by all the tags.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic