wood burning stoves 2.0*
The moose likes JSP and the fly likes tag lib question - urgent Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "tag lib question - urgent" Watch "tag lib question - urgent" New topic
Author

tag lib question - urgent

Ernest Lee
Ranch Hand

Joined: Aug 20, 2001
Posts: 145
<a:text value="<a:value attribute="attr1"/>"/>
it is possible to have the value output by a:value tag to be used by a:text tag at all??
or we will have to have something like
<a:text>
<value="<a:value attribute="attr1"/>
</a:text>
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

..... have you tried it?
Craig Jackson
Ranch Hand

Joined: Mar 19, 2002
Posts: 405
Correct me if I am wrong, but I was under the impression that a value for an attribute can only be set to a scriptlet expression or a static(literal) value.
craig
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
Originally posted by cj jack:
Correct me if I am wrong, but I was under the impression that a value for an attribute can only be set to a scriptlet expression or a static(literal) value.

That's right - a literal value or a JSP runtime expression, although with the JSTL and JSP 2.0 you can use the included "expression language".
In answer to the original question, you can't have the result/evaluation of a tag as an attribute to another - this would effectively require a two stage translation of the page, and there's nothing to say that a tag will actually generate any content. To specify complex values, you can either use a JSP runtime expression (<%= ... %> ) or nest the tags as follows:
<a:text>
  <a:value attribute="attr1"/>
</a:text>
There are several ways of making this type of thing work - (1) have the <a:value> tag pass the data to it's parent, or (2) make <a:text> a BodyTag, have <a:value> generate some content and read this generated body content in the doEndTag() method of the <a:text> tag handler.
Hope that helps...
Simon
[ June 24, 2002: Message edited by: Simon Brown ]
 
 
subject: tag lib question - urgent