<jsp:useBean id="newsService" class="cn.kgc.service.NewsDetailServiceImpl"></jsp:useBean>
<tbody>
<%
List<NewsDetail> newsList = newsService.queryAllNewsDetail();
int i= 0;
for(NewsDetail news:newsList){
i++;
Date date=news.getCreateDate();
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String time= simpleDateFormat.format(date);
%>
<tr <%if(i%2==0){ %>class="admin-list-td-h2"<%} %>>
<td><a href='adminNewsView.jsp?id=2'><%=news.getTitle() %></a></td>
<td><%=news.getAuthor() %></td>
<td><%=time%></td>
<td><a href='adminNewsCreate.jsp?id=2'>修改</a>
<a href="javascript:if(confirm('确认是否删除此新闻?')) location='adminNewsDel.jsp?id=2'">删除</a>
</td>
</tr>
<%} %>
</tbody>
09-16
3215
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)