[Opensource] Need a Jsp tag combination that works, iterate Blocks within a Bl ock
#KARSTEN VOGES#
EX020679 at ntu.edu.sg
Tue Feb 18 18:20:43 PST 2003
I use the following code in a JSP:
<%@ taglib uri="/WEB-INF/tld/expresso-logic.tld" prefix="logic" %>
<logic:present property="navi">
<logic:iterate id="oneNavi" property="navi">
<bean:write name="oneNavi" property="label"/>:<br>
<logic:iterate id="oneTrans" name="oneNavi">
<bean:define id="det" name="oneTrans" property="url" type="java.lang.String"/>
<bean:define id="dbobj" name="oneTrans" property="@dbobj" type="java.lang.String"/>
<html:link page="<%= det %>">
<bean:write name="oneTrans" property="label"/>
</html:link><BR>
</logic:iterate>
</logic:iterate>
</logic:present>
In my java I got something like this:
Block navBlock = new Block("navi");
navBlock.setLabel("naviBlock");
Block searchBlock = new Block("Search");
searchBlock.setLabel("SEARCH");
Block addBlock = new Block("Add");
addBlock.setLabel("ADD");
navBlock.addNested(searchBlock);
while (whatever) do
Transition oneTrans = new Transition("Search", getController());
oneTrans.addParam("dbobj", oneDBObj.getName());
oneTrans.addParam("state", "Search");
oneTrans.setLabel(oneDBObj.getDescription());
searchBlock.addNested(oneTrans);
then the same with navBlock.addNested(addBlock); and a while loop over transitions.
I do not know if it is the best practice, but it works.
Hope that helps!
Karsten Voges.
More information about the Opensource
mailing list