This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Simple question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Simple question" Watch "Simple question" New topic
Author

Simple question

jose chiramal
Ranch Hand

Joined: Feb 12, 2010
Posts: 266

<logic:present name="list">
<table border="0" cellspacing="0" cellpadding="0" align="center" width="70%" style="border-collapse:collapse;">
<tr bgcolor="#98AFCC">
<th>User ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
</tr>
<%boolean even = false; %>
<logic:iterate id="user" name="list">
<% even = !even; %>
<tr bgcolor="<%=even?"#B7D3F5":"#D6E0F5" %>"> (what is #B7D3F5 and #D6E0F5 ? And how does the "even" boolean variable work here?) <td>
<bean:write name="user" property="userId" />
</td>
<td>
<bean:write name="user" property="firstName" />
</td>
<td>
<bean:write name="user" property="lastName" />
</td>
<td>
<bean:write name="user" property="email" />
</td>
</tr>
</logic:iterate>
<tr>
<td colspan="6" align="center">
<a href="adduser.jsp">Add New User</a>
</td>
</tr>
</table>
</logic:present>

Vinod Tiwari
Ranch Hand

Joined: Feb 06, 2008
Posts: 459
    
    1
It is for setting background color.... refer some html tutorial.


Vinod Tiwari | Twitter
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

what is #B7D3F5 and #D6E0F5 ?

Hex color code.
And how does the "even" boolean variable work here?

Its ternary operator, and its takes the boolean as its first parameter, right ?

And Use meaningful subject line and edit the post with code tags.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
 
Consider Paul's rocket mass heater.
 
subject: Simple question
 
Similar Threads
looping with iterate tag in struts
Iterate List on jsp (struts)
Set bean property values
Deleting checked rows in struts.
javax.servlet.ServletException:javax.servlet.jsp.JspException: Cannot find bean: "riga" in any scope