This could/should be put into an Action

/*           ArrayList al = (ArrayList) request.getAttribute("al");

            if (al != null) {
                for (int i=0;i<al.size()/2;i++) {
                    SystemProfileData spd = (SystemProfileData)
al.get(i);
                    if (i==0)
                        int topmsg = spd.getSentCount();
*/

The spd.getSentCount() should give u the correct top message. No need to
count it. But if you can't then you could either create a new property
which shows this or create a bean which you could hold your values

/*           
 <td width="<%=topmsg!=0?spd.getSentCount()*80/topmsg:0%>%"></td>
*/

for writing out properties you could use <bean:write name="beanName"
property="propertyName" />

for html link <html:link >

Look here for more info http://jakarta.apache.org/struts/userGuide/

Amin
-----Original Message-----
From: Mohd Fadhly [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 22, 2003 12:05 PM
To: Struts Users Mailing List
Subject: how to change this logic into tags

hello,

how do i change this scriptlet logic into struts tag,

<%
            ArrayList al = (ArrayList) request.getAttribute("al");

            if (al != null) {
                for (int i=0;i<al.size()/2;i++) {
                    SystemProfileData spd = (SystemProfileData)
al.get(i);
                    if (i==0)
                        int topmsg = spd.getSentCount();
%>
    <table border=0 width=100%>
    <tr><td width="20%"><%=spd.getName()%></td>
    <td>
        <table border=0 width=100% cellspacing="0" cellpadding="0">
            <td
width="<%=topmsg!=0?spd.getSentCount()*80/topmsg:0%>%"></td>
            <td 
width="<%=topmsg!=0?100-(spd.getSentCount()*80/topmsg):0%>%">><%=spd.get
SentCount()%></td>
        </table>
    </td>
    </tr></table>
<%                 }
            }
%>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to