If I do:
<% pageContext.setAttribute("foo", "bar"); %>
<custom:myTag/>
it seems like I should be able to do:
<%= pageContext.getAttribute("foo") %>
inside of myTag.tag ... but of course I can't because the tag file doesn't have access to the pageContext (instead it has access to a jspContext ... which doesn't have the same attributes as the calling page's pageContext).
Now, you can access the pageContext via ELScript:
${pageContext}
but that doesn't help because ELScript has no way of passing arguments, so you can't do:
${pageContext.getAttribute("foo")}
However, the fact that ELscript can accesss the page context, and the fact that the tag can access all sorts of variables like jspContext, that there must be some way for a tag to access (in a scriptlet/Java logic way, not just in ELScript) an attribute from the calling JSP's pageContext.
Is there?