File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Simple question" Watch "Simple question" New topic

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>
<%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" />
<bean:write name="user" property="firstName" />
<bean:write name="user" property="lastName" />
<bean:write name="user" property="email" />
<td colspan="6" align="center">
<a href="adduser.jsp">Add New User</a>

Vinod Tiwari
Ranch Hand

Joined: Feb 06, 2008
Posts: 466

It is for setting background color.... refer some html tutorial.

Vinod Tiwari | Twitter | Shikshanirman | Guftgu
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2904

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]
I agree. Here's the link:
subject: Simple question
It's not a secret anymore!