File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "tag value in tag attribute" Watch "tag value in tag attribute" New topic

tag value in tag attribute


Joined: Mar 27, 2001
Posts: 6
How do I insert a tag value in a second tag attribute. E.g.
<%@ 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 />
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:
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:
subject: tag value in tag attribute
It's not a secret anymore!