wood burning stoves 2.0*
The moose likes Servlets and the fly likes tag value in tag attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "tag value in tag attribute" Watch "tag value in tag attribute" New topic
Author

tag value in tag attribute

FredLoney
Greenhorn

Joined: Mar 27, 2001
Posts: 6
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).]


Fred Loney<br />Spirited Software, Inc.<br />loney@spiritedsw.com
Angela Lamb
Ranch Hand

Joined: Feb 22, 2001
Posts: 156
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

Joined: Nov 06, 2000
Posts: 92
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
 
subject: tag value in tag attribute