struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roland Carlsson" <rolan...@swetravel.se>
Subject Re: use logic:Iterate display multi-record from the database
Date Wed, 18 Dec 2002 08:33:06 GMT
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" <frank@bleum.com>
To: <struts-user@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:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message