I want to do something like this to call a JSP 2.0 tag:
<mytags:foo abc="<%=def%>">
<mytags:bar ghi="<%=jkl%>"/>
</mytags:foo>
Where Strings def
and jkl
are defined earielr in the jsp file. Suppose my tag files look like this:
foo.tag
:
<%@ tag body-content="scriptless" %>
<%@ attribute name="abc" required="true" %>
<div class="${abc}">
<jsp:doBody/>
</div>
bar.tag
:
<%@ tag body-content="scriptless" %>
<%@ attribute name="ghi" required="true" %>
<div>${ghi}</div>
I want the output to look like this:
<div class="def">
<div>jkl</div>
</div>
(assuming the variables def
and jkl
were initialized to def
and jkl
, respectively, in the calling JSP file.)
The outer tag gets its attribute just fine (<div class="def">
) but the inner one fails.
Is this possible? I am getting errors that jkl cannot be resolved.