<%-- Specify the use of the util taglib --%>
<%@ page import="java.text.*" %>
<% DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.LONG, request.getLocale()); %>
<%@ taglib uri="utiltags" prefix="util" %>

		<jsp:useBean id="children" type="java.util.Collection" scope="request" />
			
		<table border="2" width="50%">
			<tr><td bgcolor="7070a0"><b>Date</b></td><td bgcolor="7070a0"><b>Subject</b></td></tr>
			
			<%-- Iterate thru the news items, max 10 of them --%>
			<util:iterate id="news" type="com.evermind.ejb.NewsView" collection="<%=children%>" max="10">
				<tr>
					<td bgcolor="ffffff"><%=dateFormat.format(news.getDate())%></td>
					<td bgcolor="ffffff">
						<jsp:getProperty name="news" property="subject" />
						(<a href="newsdetail.jsp?id=<%=news.getId()%>">detail</a>)
						<util:ifInRole role="administrators">
							(<a href="admin/editnews.jsp?id=<%=news.getId()%>">edit</a>)
						</util:ifInRole>
					</td>
				</tr>
			</util:iterate>
		</table>
