[Opensource] REPOST: Outputting elements in JSP (Marc Schipperheyn)
Marc Schipperheyn
m.schipperheyn at thefactore.com
Fri Jul 5 06:49:12 PDT 2002
Hi all,
I'm a newbie running into a wall trying to output 'blocked' information. I
can't seem to get anything on screen and I don't know what to try anymore.
Please help! As a newbie it is pretty hard getting to grips with Expresso!
The documentation in this area is virtually non-existent.
Here's my code:
**External State run method**
Block blockList = new Block("Dierenoverzicht");
Dier dierInit = new Dier();
dierInit.setDBName("dieren");
ArrayList list = soortInit.searchAndRetrieveList("Categorie");
int size = list.size();
ArrayList lDier = dierInit.searchAndRetrieveList("Dier");
System.out.println(lDier.size());//recordcount = 2
for(int x=0; x < lDier.size();x++){
Dier dier = (Dier) lDier.get(x);
Block blok2 = new Block("Dier" + x);
Output out = new Output();
out.setName("dierOverzicht");
out.setAttribute("dierID", dier.getField("dierID"));
out.setAttribute("DierNaam", dier.getField("dier"));
blok2.add(out);
Transition trans = new Transition("KlikDier",
getClass().getName());
trans.addParam("id", dier.getField("dierID"));
blok2.add(trans);
blockList.add(blok2);
}
res.add(blockList);
**JSP file**
<expresso:ElementCollection type="block">
<expresso:ElementIterator>
<expresso:IfElementExists name="blok2" type="block">
xx
<expresso:ElementCollection type="block">
yy
<expresso:ElementIterator>
zz
<expresso:ElementCollection type="output">
output
<expresso:ElementIterator>
<expresso:OutputTag name="dierOverzicht">
overzicht
<table>
<tr>
<td colspan="2">
<!--Dier naam-->
<expresso:AttributeTag name="DierNaam" />
</td>
</tr>
</table>
</expresso:OutputTag>
</expresso:ElementIterator>
</expresso:ElementCollection>
</expresso:ElementIterator>
</expresso:ElementCollection>
</expresso:IfElementExists>
</expresso:ElementIterator>
</expresso:ElementCollection>
The page is printing:
xx
yy
zz
Can anyone shine some light on this? It would be really great if we could
create a tag that'll take any kind of Block structure and dump a structure
view of it on screen for debugging puposes (similar to CFDUMP in Cold
Fusion). My problem is not just how to get this to work but also how to
debug this kind of problem properly.
Kind regards,
Marc
More information about the Opensource
mailing list