I just noticed that class XSPUtil (the implementing class for util taglib)
has the following function, which also shows how to get context info in
Java:

public static Object getContextAttribute(Map objectModel, String name)
{
        Context context = ObjectModelHelper.getContext(objectModel);
        return context.getAttribute(name);
}

In XSP (assuming XSPUtil class is already imported):


<xsp:logic>
        // objectModel is already a local var available to your XSP
        String attr = XSPUtil.getContextAttribute(objectModel, "foo");

        // If you want this for anything else....
        Context context = ObjectModelHelper.getContext(objectModel);
</xsp:logic>

<debug><xsp:expr>context.getAttribute("bar")</xsp:expr></debug>



Per


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to