I must be blind or using the wrong search terms because I cannot find a good answer on this.
I have two custom JPS tag files. One will be nested within the other one. How can I access an attribute in the parent tag from inside the child tag?
One workaround is to add add a variable to request scope, but I'm not loving this option and it might cause some problems. Is there's a more straightforward option?
Thanks!
<%-- OuterTag.tag --%>
--------------------------------------
<%@tag %>
<%@attribute name="color" required="true" %>
<c:set var="color" value="${color}" scope="request" /> <%-- I'm trying to avoid doing this --%>
<div>
<jsp:doBody/>
</div>
<%-- InnerTag.tag --%>
--------------------------------------
<%@tag %>
<p style="background-color: ${parent.color}"/> <%-- I want to do something like this --%>
<%-- Example Usage --%>
--------------------------------------
<custom:OuterTag color="red">
<custom:InnerTag/>
<custom:InnerTag/>
<custom:InnerTag/>
</custom:OuterTag>