I want to do something like this to call the JSP 2.0 tag:
<mytags:foo abc="<%=def%>">
<mytags:bar ghi="<%=jkl%>"/>
</mytags:foo>
Where are the lines def
and are jkl
defined in the jsp earielr 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 result to look like this:
<div class="def">
<div>jkl</div>
</div>
(assuming that the variables def
and jkl
are initialized, respectively, def
and jkl
in the calling JSP file.)
The outer tag gets its attribute just fine ( <div class="def">
), but the inner one doesn't work.
Is it possible? I get errors that cannot be resolved by jkl.
source
share