cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Per Kreipke" <...@onclave.com>
Subject RE: XSP logicsheet for the ServletContext object
Date Fri, 16 Aug 2002 22:00:10 GMT
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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message