You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by frank <fr...@bleum.com> on 2002/12/18 09:17:05 UTC

use logic:Iterate display multi-record from the database

Hi, all
I'm a new of struts.
I want to use logic:Iterate to display the multi-record from the
database, and for each record I use a bean to store as showdata. The
total data are stored in the groupshowdata.
Can I use the logic:Iterate taglib? Can someone give some simple
example?
Any help will be welcome.
 
 
Best regard!
 
Frank
Software Engineer
Bleum Incorporated
9E East Building, Hi-Tech King World
668 East Beijing Road.
Shanghai, P.R.C.200001
Phone: (8621) 5308 1196
http:// www.bleum.com
 

Re: use logic:Iterate display multi-record from the database

Posted by Jitendra Singh <ji...@hotmail.com>.
hi all,
I am working on a similar problem with my colleague Murthy.
I have made a custom tag that will display a given number of records per
page from a table.I beleive this is a common problem and it can be put in
the the logic tld or some other where it is appropriate.

But i don' know how to do it...

Please guide me...

frank,
If u are intersted tell me i will send u the package .. its for oracle. I
hope to complete it by enveing.

cheers!
Jitendra


----- Original Message -----
From: "frank" <fr...@bleum.com>
To: <st...@jakarta.apache.org>
Sent: Wednesday, December 18, 2002 1:47 PM
Subject: use logic:Iterate display multi-record from the database


> Hi, all
> I'm a new of struts.
> I want to use logic:Iterate to display the multi-record from the
> database, and for each record I use a bean to store as showdata. The
> total data are stored in the groupshowdata.
> Can I use the logic:Iterate taglib? Can someone give some simple
> example?
> Any help will be welcome.
>
>
> Best regard!
>
> Frank
> Software Engineer
> Bleum Incorporated
> 9E East Building, Hi-Tech King World
> 668 East Beijing Road.
> Shanghai, P.R.C.200001
> Phone: (8621) 5308 1196
> http:// www.bleum.com
>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: use logic:Iterate display multi-record from the database

Posted by Roland Carlsson <ro...@swetravel.se>.
Hi!
I have a class that represents a login and have a java.util.Vector of
superLogins named userLevel.


Regards Roland


public class Login{
 private String name
 private String password
 private java.util.Vector userLevel;
/*
  getter and setters
*/
}

To view this login and it's superrights I user this code:

<%@ taglib prefix="html" uri="/WEB-INF/struts-html.tld" %>
<%@ taglib prefix="bean" uri="/WEB-INF/struts-bean.tld" %>
<%@ taglib prefix="logic" uri="/WEB-INF/struts-logic.tld" %>
<logic:present name="rdc_shop_Login_loginById" scope="request">
<h1>Logindetail</h1>
<table>
    <tr>
        <td>Name<td>
        <td><bean:write name="rdc_shop_Login_loginById" property="name" />
    </tr>
    <tr>
        <td>Password<td>
        <td><bean:write name="rdc_shop_Login_loginById" property="password"
/>
    <tr>
       <td></td>
       <td>UserLevels</td>
    <tr>
<logic:iterate id="element" name="rdc_shop_Login_loginById"
property="userLevel">
    <tr>
        <td></td>
       <td><bean:write name="element" property="name" /></td>
       <td>
            <html:form action="/admin/revokeUserLevel.do">
                <input type="hidden" name="loginId" value="<bean:write
name="rdc_shop_Login_loginById" property="id" />">
                <input type="hidden" name="userLevelId" value="<bean:write
name="element" property="id" />">
                <input type="submit" value="Revoke">
            </html:form>
    </tr>
</logic:iterate>


</table>
</logic:present>
----- Original Message -----
From: "frank" <fr...@bleum.com>
To: <st...@jakarta.apache.org>
Sent: Wednesday, December 18, 2002 9:17 AM
Subject: use logic:Iterate display multi-record from the database


> Hi, all
> I'm a new of struts.
> I want to use logic:Iterate to display the multi-record from the
> database, and for each record I use a bean to store as showdata. The
> total data are stored in the groupshowdata.
> Can I use the logic:Iterate taglib? Can someone give some simple
> example?
> Any help will be welcome.
>
>
> Best regard!
>
> Frank
> Software Engineer
> Bleum Incorporated
> 9E East Building, Hi-Tech King World
> 668 East Beijing Road.
> Shanghai, P.R.C.200001
> Phone: (8621) 5308 1196
> http:// www.bleum.com
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>