[Opensource] Outputting something on screen - Desperate

Ilian Alekov ialekov at tlogica.com
Mon Jul 22 06:51:32 PDT 2002


Hi,  Marc!


That is the way I do it:

I write this code in my state:

    Block B1 = new Block();
    B1.setName("fooRoot");
    myResponse.addBlock(B1);
    for(int x=0;x<5;x++){
       Output out01= new Output() ;
       out01.setName("List1");
       out01.setAttribute("itemID", "itemID"+String.valueOf(x));
       out01.setAttribute("Product", "ProductName"+String.valueOf(x));
       B1.addNested(out01);
    }

And this piece of code in my .jsp

<logic:iterate id="List1" property="fooRoot">
    <bean:write name="List1" property="@itemID"/>:<bean:write 
name="List1" property="@Product"/><br>
</logic:iterate>

so, I get the result:

itemID0:ProductName0
itemID1:ProductName1
itemID2:ProductName2
itemID3:ProductName3
itemID4:ProductName4

I hope this will help you!

Ilian.


Marc Schipperheyn wrote:

>Hi,
>
>I'm trying to get a structure like below on screen
>Output out0 = new Output();
>out0.setName("fooRoot");
>for(int x=0;x<5;x++){
>	Output out01= new Output()
>	out01.setName("List1");
>	out01.setAttribute("itemID", db.getField("itemID"));
>	out01.setAttribute("Product", db.getField("ProductName"));
>	out0.addNested(out01);
>}
>
>What jsp do I need to write?
>
>Any combination of ElementCollection and Iterate fails. I've completely
>given up on using the more elegant Blocks.
>The only way I can get something on screen is by using a nested OutputTag,
>but that only shows the first item in the list.
>
>I've been banging my head against a wall trying to use the taglib of
>Expresso the last couple of weeks. I'm just wondering. Is anyone using those
>at all? What is the official post Orange Trader (uses custom non-Expresso
>library) proper way of writing JSP? Or is everybody using the Struts-library
>(if so, can anyone give me an example based on my piece of code?). Or does
>everybody use XSLT? It just seems so weird that it's so hard to do something
>so simple. I'd love to write some decent documentation on this, but I need
>to get past newbie stage first and that's damn hard with Expresso.
>
>Kind regards,
>
>Marc Schipperheyn
><theFactor.e>
>
>Premium Partner for Macromedia
>
>The future is technological, but it will not be a world of gray steel
>
>
>_______________________________________________
>Opensource mailing list
>Opensource at jcorporate.com
>http://mail.jcorporate.com/mailman/listinfo/opensource
>Archives: http://mail.jcorporate.com/pipermail/opensource/
>
>  
>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3249 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mailman.jcorporate.com/pipermail/opensource/attachments/20020722/b27d1e68/smime-0002.bin


More information about the Opensource mailing list