Oh well, here goes:
1) Add the following lines at the top of the file:
<%@ page import="com.bas.shared.domain.configuration.elements.Query" %>
<%@ page import="com.bas.shared.domain.operation.IEntity" %>
<%@ page import="com.bas.shared.data.QueryResult" %>
<%@ page import="com.bas.webapp.misc.WebAppUtils" %>
2) Add the following lines before the <body> tag:
<%
String attrValue = "";
Query q = Query.createFromRuleLanguageString ("FIND MyObject WHERE ...");
QueryResult result = (QueryResult) WebAppUtils.sendMessageToExecutionEngine (session.getServletContext(), session, "executeQuery", new Object [] { q, new Integer (1), new Integer (1), null, null }, 1000000);
IEntity [] ents = result.getEntities ();
if (ents != null && ents.length > 0)
attrValue = ents [0].getAttributeValue ("NameOfObjectAttribute");
%>
You can then use attrValue in the HTML tags using it like this
<%=attrValue%>